Commit Graph

44206 Commits (7cdb0eb89f204be1250fc4e3352da5361ede9fb0)

Author SHA1 Message Date
Clayton Coleman 7cdb0eb89f
NamePrinter should not hardcode scheme 2017-02-23 00:28:31 -05:00
Clayton Coleman 19ae89dcd8
command Factory should provide Printers
The factory knows all possible types, and should abstract the process of
creating all printers. A future refactor can further reduce the
dependencies between printer code and internal types.
2017-02-23 00:28:31 -05:00
Clayton Coleman 90fdd067e9
Restrict imports for printers 2017-02-23 00:28:31 -05:00
Clayton Coleman a9c03f292b
UnstructuredList should return 'items' set to the children
The set of items is not mutable (can't add or remove items) but the list
now is. Needs to be improved to make mutability is clear.
2017-02-23 00:28:31 -05:00
Clayton Coleman 3704ceffd2
Refactor printers to separate typed printers from generic code 2017-02-23 00:28:30 -05:00
Clayton Coleman 6d1c7308a5
Move, but do not refactor, printers to their own package 2017-02-23 00:28:30 -05:00
Kubernetes Submit Queue c36eee2a0c Merge pull request #41784 from dixudx/fix_issue_41746
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784)

fix issue #41746

**What this PR does / why we need it**:

**Which issue this PR fixes** : fixes #41746 

**Special notes for your reviewer**:

cc @feiskyer
2017-02-22 21:09:38 -08:00
Kubernetes Submit Queue c99ae4b436 Merge pull request #41538 from xingzhou/clusterrole
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784)

Added `kubectl create clusterrole` command.

Added `kubectl create clusterrole` command.

Fixed part of #39596 

**Special notes for your reviewer**:
@deads2k, please help to review this patch, thanks

**Release note**:
```
   Added one new command `kubectl create clusterrole` to help user create a single ClusterRole from command line.
```
2017-02-22 21:09:36 -08:00
Kubernetes Submit Queue 4396f19c61 Merge pull request #41482 from ncdc/shared-informers-11-statefulset
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784)

Switch statefulset controller to shared informers

Originally part of #40097 

I *think* the controller currently makes a deep copy of a StatefulSet before it mutates it, but I'm not 100% sure. For those who are most familiar with this code, could you please confirm?

@beeps @smarterclayton @ingvagabund @sttts @liggitt @deads2k @kubernetes/sig-apps-pr-reviews @kubernetes/sig-scalability-pr-reviews @timothysc @gmarek @wojtek-t
2017-02-22 21:09:35 -08:00
Kubernetes Submit Queue e49f44d89c Merge pull request #41486 from sttts/sttts-clientset-scheme
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784)

client-gen: independent scheme for clientsets

This PR adds a clientset internal scheme instead of using `pkg/api.Scheme`. **The clientset API stays the same.**

In detail:

- introduce a scheme for each clientset, i.e. do not use `pkg/api.Scheme+Registry+Codec+ParameterCodecs`.

  This makes it easier to compose client-go's clientset (which is rewritten in `staging/copy.sh` and therefore hardcoded to use `k8s.io/client-go/pkg/api.Scheme+Registry+Codecs+ParameterCodecs`) with third-party clientsets (kube-aggregator, openshift, federation) which are not rewritten using `copy.sh` as all of them are self-contained and therefore relocatable.

  This fixes https://github.com/kubernetes/kubernetes/pull/41403/files#diff-76edfb07dee54ff7ddeda25c33c10d29R81 and prepares client-gen for use in OpenShift.

- register types into the clientset scheme via `AddToScheme` for versioned clientsets. This decouples the client-go clients from announce+registration (internal clients continue using announce+registry and apigroup installers).

  This reduces complexity for client-go, possibly remove the necessity for the announce+register machinery for many use-cases, maybe even to delete it mid-term.
- port federation and testgroup  `install/install.go` to `announced.GroupMetaFactory` in order to have a proper `Install.Install(...)` func for registration.

With the first change it's easy to add the types of one clientset to the scheme of the other using the `clientset/scheme.AddToScheme` method. This allows to use cross-clientset `runtime.RawExtensions`:

```golang
import (
     "k8s.io/client-go/kubernetes"
     clientsetscheme "k8s.io/client-go/kuberentes/scheme"
     aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
)

kclientset, _ := kubernetes.NewForConfig(c)
aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
```
Kubernetes types with a `RawExtension` can en/decode aggregator types after this.

TODO:
- [x] fix fake clientsets
- [x] get the `*Options` types registered correctly for core, compare DO-NOT-MERGE commit.
- [x] get prefered version right in internal client. Do we need all versions registered in the internal client to support negotiation?
- [x] run `staging/copy.sh` and run tests: https://github.com/kubernetes/kubernetes/pull/41744
- ~~[ ] fixup usage through-out the code-base~~
- **Follow-up**: move `import_known_versions.go` files somewhere such that import of the `api.Scheme` package automatically installs the apigroups. It looks like we depended on the import fo the clientset for this purpose.
2017-02-22 21:09:33 -08:00
Kubernetes Submit Queue afd3db25cf Merge pull request #41146 from shiywang/apply-view1
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784)

 Add apply view-last-applied subcommand

reopen pr https://github.com/kubernetes/kubernetes/pull/40984, implement part of https://github.com/kubernetes/community/pull/287
for now unit test all pass, the output looks like:

```console
shiywang@dhcp-140-33 template $ ./kubectl apply view last-applied deployment nginx-deployment 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  name: nginx-deployment
spec:
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx:1.12.10
        name: nginx
        ports:
        - containerPort: 80
        resources: {}
status: {}
```

```release-note
Support new kubectl apply view-last-applied command for viewing the last configuration file applied
```

not sure if there is any flag I should updated or the some error handling I should changed.
will generate docs when you guys think is ok.
cc @pwittrock @jessfraz @AdoHe @ymqytw
2017-02-22 21:09:31 -08:00
Kubernetes Submit Queue 9cbaff9e0f Merge pull request #41373 from msau42/e2e-pvutil
Automatic merge from submit-queue (batch tested with PRs 38957, 41819, 41851, 40667, 41373)

Move pvutil.go from e2e package to framework package

**What this PR does / why we need it**:  

This PR moves pvutil.go to the e2e/framework package.

I am working on a PV upgrade test, and would like to use some of the wrapper functions in pvutil.go.  However, the upgrade test is in the upgrade package, and not the e2e package, and it cannot import the e2e package because it would create a circular dependency.  So pvutil.go needs to be moved out of e2e in order to break the circular dependency.  This is a refactoring name change, no logic has been modified.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: 

**Special notes for your reviewer**:

**Release note**:

NONE
2017-02-22 19:59:37 -08:00
Kubernetes Submit Queue 3560ac3193 Merge pull request #40667 from brendandburns/i18n7
Automatic merge from submit-queue (batch tested with PRs 38957, 41819, 41851, 40667, 41373)

Wrap and extract some flag description strings.

Moving on from help strings to flag descriptions.

@zen @fabianofranz @kubernetes/sig-cli-pr-reviews
2017-02-22 19:59:36 -08:00
Kubernetes Submit Queue 7cca0d1867 Merge pull request #41851 from janetkuo/deployment-duplicate-rs
Automatic merge from submit-queue (batch tested with PRs 38957, 41819, 41851, 40667, 41373)

Fix deployment helper - no assumptions on only one new ReplicaSet

#40415

**Release note**:

```release-note
NONE
```

@kubernetes/sig-apps-bugs
2017-02-22 19:59:34 -08:00
Kubernetes Submit Queue 59f4c5911a Merge pull request #41819 from dchen1107/master
Automatic merge from submit-queue (batch tested with PRs 38957, 41819, 41851, 40667, 41373)

Bump GCI to gci-stable-56-9000-84-2

Changelogs since gci-beta-56-9000-80-0:

- Fixed google-accounts-daemon breaks on GCI when network is unavailable.
- Fixed iptables-restore performance regression.

cc/ @adityakali @Random-Liu @fabioy
2017-02-22 19:59:33 -08:00
Kubernetes Submit Queue 6024f56f80 Merge pull request #38957 from aveshagarwal/master-taints-tolerations-api-fields
Automatic merge from submit-queue (batch tested with PRs 38957, 41819, 41851, 40667, 41373)

Change taints/tolerations to api fields

This PR changes current implementation of taints and tolerations from annotations to API fields. Taint and toleration are now part of `NodeSpec` and `PodSpec`, respectively. The annotation keys: `scheduler.alpha.kubernetes.io/tolerations` and `scheduler.alpha.kubernetes.io/taints`  have been removed.

**Release note**:
Pod tolerations and node taints have moved from annotations to API fields in the PodSpec and NodeSpec, respectively. Pod tolerations and node taints that are defined in the annotations will be ignored. The annotation keys: `scheduler.alpha.kubernetes.io/tolerations` and `scheduler.alpha.kubernetes.io/taints`  have been removed.
2017-02-22 19:59:31 -08:00
Kubernetes Submit Queue fcb234e580 Merge pull request #41920 from fejta/spiffxp
Automatic merge from submit-queue

Make spiffxp an owner of test/...
2017-02-22 18:18:29 -08:00
Kubernetes Submit Queue ae8f537c87 Merge pull request #41688 from humblec/iscsi-reviewer
Automatic merge from submit-queue

Update reviewer list for iscsi volume plugin.

Contributed nodiskconflict, multipath feature .etc to iscsi volume plugin. 
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-22 18:18:22 -08:00
Kubernetes Submit Queue b164e64619 Merge pull request #41660 from calebamiles/wip-sig-owners-for-tests
Automatic merge from submit-queue

Removes additional columns in test_owners.csv

**What this PR does / why we need it**:

fixes a huge collection of typos with the number of columns in the CSV file that probably has broken the auto assign bot

**Special notes for your reviewer**:

None

**Release note**:

`NONE`
2017-02-22 18:18:14 -08:00
Saad Ali 9b12e372d7 Merge pull request #41933 from ixdy/list-resources-grep
list-resources: don't fail if the grep fails to match any resources
2017-02-22 16:14:32 -08:00
Jeff Grafton eeec939361 Don't fail if the grep fails to match any resources 2017-02-22 14:55:57 -08:00
Janet Kuo a8506813dc Generated: update staging GoDeps 2017-02-22 13:29:33 -08:00
Janet Kuo 3718749c4a Fix deployment helper - no assumptions on only one new ReplicaSet 2017-02-22 13:18:33 -08:00
Erick Fejta 53377b1f20 Make spiffxp an owner of test/... 2017-02-22 12:50:17 -08:00
Eric Paris 2e12711160 Merge pull request #41910 from sjenning/fix-staging-godeps
fix staging godeps
2017-02-22 14:22:33 -05:00
Seth Jennings 258f54bdf4 fix staging godeps 2017-02-22 12:15:21 -06:00
Dr. Stefan Schimanski 595f4ed2cb Update generated files 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 92c36bed4a client-set: use clientset internal scheme 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 49c536baee client-gen: general cleanup 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 0834ff7943 Switch to GroupMetaFactory in federation and clientset testgroup 2017-02-22 19:03:25 +01:00
Kubernetes Submit Queue e43e663a53 Merge pull request #41650 from deads2k/api-02-godep
Automatic merge from submit-queue

add godep manifest files to staging repos

The staging repos should have manifests that match the godeps of kube so we know what they build against.  We don't need the actual vendored code, since a sync script on the other side needs to find the correct level of other staging directories and thus requires its own `godep restore && go get && godep save` cycle.

@sttts ptal
@lavalamp @caesarxuchao client-go needs a lot of unwinding to do something similar, but the idea is that you can run an acyclic path to get this updated by copying the types and dependencies with `go list`, then generate the clients, then generate this manifest.  Then in your sync script you can pull the proper levels and finish the actual vendoring.
2017-02-22 08:56:27 -08:00
Kubernetes Submit Queue 44aa1679c9 Merge pull request #41657 from bowei/update-dns
Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

Update dns

```release-note
NONE
```
2017-02-22 08:12:48 -08:00
Kubernetes Submit Queue fe34705f8a Merge pull request #41587 from MrHohn/addon-manager-fix-hpa
Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

Update kubectl in addon-manager to use HPA in autoscaling/v1

Addon-manager is broken since HPA objects were removed from extensions api group.

Came across the logs from [the latest addon-manager on Jenkins](https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce/4290/artifacts/bootstrap-e2e-master/kube-addon-manager.log):
```
INFO: == Entering periodical apply loop at 2017-02-16T17:33:37+0000 ==
error: error pruning namespaced object extensions/v1beta1, Kind=HorizontalPodAutoscaler: the server could not find the requested resource
WRN: == Failed to execute /usr/local/bin/kubectl  apply --namespace=kube-system -f /etc/kubernetes/addons     --prune=true -l kubernetes.io/cluster-service=true --recursive >/dev/null at 2017-02-16T17:33:38+0000. 2 tries remaining. ==
error: error pruning namespaced object extensions/v1beta1, Kind=HorizontalPodAutoscaler: the server could not find the requested resource
WRN: == Failed to execute /usr/local/bin/kubectl  apply --namespace=kube-system -f /etc/kubernetes/addons     --prune=true -l kubernetes.io/cluster-service=true --recursive >/dev/null at 2017-02-16T17:33:46+0000. 1 tries remaining. ==
error: error pruning namespaced object extensions/v1beta1, Kind=HorizontalPodAutoscaler: the server could not find the requested resource
WRN: == Failed to execute /usr/local/bin/kubectl  apply --namespace=kube-system -f /etc/kubernetes/addons     --prune=true -l kubernetes.io/cluster-service=true --recursive >/dev/null at 2017-02-16T17:33:53+0000. 0 tries remaining. ==
WRN: == Kubernetes addon update completed with errors at 2017-02-16T17:33:58+0000 ==
```

And notice this commit (f66679a4e9) came in two weeks ago, which removed HorizontalPodAutoscaler from extensions/v1beta1.

Addon-manager is now partially functioning that it could successfully create and update addons, but will fail to prune objects, which means upgrade tests may mostly fail.

Pushed another version of addon-manager with kubectl v1.6.0-alpha.2 ([release 2 days ago](https://github.com/kubernetes/kubernetes/releases/tag/v1.6.0-alpha.2)) for fixing, including below images:
- gcr.io/google-containers/kube-addon-manager:v6.4-alpha.2
- gcr.io/google-containers/kube-addon-manager-amd64:v6.4-alpha.2
- gcr.io/google-containers/kube-addon-manager-arm:v6.4-alpha.2
- gcr.io/google-containers/kube-addon-manager-arm64:v6.4-alpha.2
- gcr.io/google-containers/kube-addon-manager-ppc64le:v6.4-alpha.2
- gcr.io/google-containers/kube-addon-manager-s390x:v6.4-alpha.2

@mikedanese 

cc @wojtek-t @shyamjvs
2017-02-22 08:12:46 -08:00
Kubernetes Submit Queue b29bdee735 Merge pull request #41256 from mbruzek/mbruzek-juju-lint-fixes
Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

Lint fixes for the master and worker Python code.

**What this PR does / why we need it**: lint fixes for the python code.

**Which issue this PR fixes** none

**Special notes for your reviewer**: This is lint fixes for the Juju python code.

**Release note**:

```release-note
NONE
```

Please consider these changes so we can pass flake8 lint tests in our build process.
2017-02-22 08:12:43 -08:00
Kubernetes Submit Queue c58266c826 Merge pull request #41532 from ericchiang/kubectl-auth-providers
Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

client-go: don't import client auth provider packages

Both of these auth providers are useful for kubectl but not so much for everyone importing client-go. Let users optionally import them (example [0]) and reduce the overall number of imports that client-go requires.

Quick grep seems to imply it wont import it after.

```
$ grep -r 'client-go/plugin/pkg/client/auth' staging/
staging/src/k8s.io/client-go/plugin/pkg/client/auth/plugins.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
staging/src/k8s.io/client-go/plugin/pkg/client/auth/plugins.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
staging/src/k8s.io/client-go/examples/third-party-resources/main.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go:	_ "k8s.io/client-go/plugin/pkg/client/auth"
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset/clientset.go:	_ "k8s.io/client-go/plugin/pkg/client/auth"
```

closes https://github.com/kubernetes/client-go/issues/49
updates https://github.com/kubernetes/client-go/issues/79 (removes cloud.google.com/go import)

cc @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-auth-pr-reviews 

```release-notes
client-go no longer imports GCP OAuth2 and OpenID Connect packages by default.
```

[0] 8b466d64c5/examples/third-party-resources/main.go (L34-L35)
2017-02-22 08:12:40 -08:00
Kubernetes Submit Queue d1687d2f67 Merge pull request #41349 from derekwaynecarr/enable-pod-cgroups
Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

Enable pod level cgroups by default

**What this PR does / why we need it**:
It enables pod level cgroups by default.

**Special notes for your reviewer**:
This is intended to be enabled by default on 2/14/2017 per the plan outlined here:
https://github.com/kubernetes/community/pull/314

**Release note**:
```release-note
Each pod has its own associated cgroup by default.
```
2017-02-22 08:12:37 -08:00
Avesh Agarwal b679e13c91 Auto generated stuff. 2017-02-22 09:27:42 -05:00
Avesh Agarwal b4d3d24eaf Update tests. 2017-02-22 09:27:42 -05:00
Avesh Agarwal 9b640838a5 Change taint/toleration annotations to api fields. 2017-02-22 09:27:42 -05:00
Andy Goldstein f6a186b1e1 Switch statefulset controller to shared informers 2017-02-22 08:53:51 -05:00
Kubernetes Submit Queue eef16cf141 Merge pull request #41240 from Random-Liu/update-npd-test
Automatic merge from submit-queue (batch tested with PRs 41844, 41803, 39116, 41129, 41240)

NPD: Update NPD test.

For https://github.com/kubernetes/node-problem-detector/issues/58.

Update NPD e2e test based on the new behavior.

Note that before merging this PR, we need to merge all pending PRs in npd, and release the v0.3.0-alpha.1 version of NPD.

/cc @dchen1107 @kubernetes/node-problem-detector-reviewers
2017-02-22 05:48:45 -08:00
Kubernetes Submit Queue e1b174842a Merge pull request #41129 from atlassian/cleanup-client-example
Automatic merge from submit-queue (batch tested with PRs 41844, 41803, 39116, 41129, 41240)

Cleanup client example

**What this PR does / why we need it**:
- Package level `config` variable in `third-party-resources/main.go` is not used, it is shadowed by the one defined in `main()`. Should probably be deleted.
- Package level `kubeconfig ` variable in `out-of-cluster/main.go` is global - make it private to `main()`.

**Which issue this PR fixes**
This fixes https://github.com/kubernetes/client-go/issues/59, except the part about global `api.Scheme`, also adds test with interface check. Supersedes https://github.com/kubernetes/client-go/pull/61.

**Special notes for your reviewer**:
This is my first PR to Kubernetes :)
2017-02-22 05:48:43 -08:00
Kubernetes Submit Queue e8ff10ce29 Merge pull request #39116 from caesarxuchao/fix-event-expansion
Automatic merge from submit-queue (batch tested with PRs 41844, 41803, 39116, 41129, 41240)

core/v1/event_expansion.go use v1.GetReference

Fix https://github.com/kubernetes/client-go/issues/47.
2017-02-22 05:48:40 -08:00
Kubernetes Submit Queue af4513cd3f Merge pull request #41803 from wojtek-t/allowed_not_running_pods
Automatic merge from submit-queue (batch tested with PRs 41844, 41803, 39116, 41129, 41240)

Allow for not-ready pods in large clusters

This is to workaround issues with non-starting pods in large clusters in roughly 1/3rd of runs.
2017-02-22 05:48:38 -08:00
Kubernetes Submit Queue 32c88a032f Merge pull request #41844 from kargakis/upgrade-test-fix
Automatic merge from submit-queue (batch tested with PRs 41844, 41803, 39116, 41129, 41240)

test: fetch updated deployment before finding new and old rss

@krousey @janetkuo ptal

Ref https://github.com/kubernetes/kubernetes/issues/41518
2017-02-22 05:48:36 -08:00
Wojciech Tyczynski e81f1cbba3 Merge pull request #41816 from DirectXMan12/bug/hpa-dont-call-unsafe-convert
HPA: Don't mutate the shared informer cache
2017-02-22 13:34:22 +01:00
Wojciech Tyczynski 6a40093cf7 Merge pull request #41873 from wojtek-t/bump_kubeproxy_resources
Increase cpu for kubeproxy in kubemark in large clusters
2017-02-22 10:04:14 +01:00
Wojciech Tyczynski 7eb7c2bedb Merge pull request #41874 from wojtek-t/fix_build
Fix broken build
2017-02-22 09:56:55 +01:00
Wojciech Tyczynski 22b67e15d4 Fix build 2017-02-22 08:58:44 +01:00
Wojciech Tyczynski fc3de292be Merge pull request #41731 from heartlock/patch-2
fix misspell "roughly" in config.go
2017-02-22 08:51:27 +01:00