Commit Graph

3213 Commits (05c046f6d339dfbc986d5966ac3a28f0e29f2d81)

Author SHA1 Message Date
juanvallejo 5ec2a4c3ca only output "No resources found." for human readable printers 2017-01-27 13:30:23 -05:00
Jordan Liggitt 9013e8a7cf
Test cascading delete without client-side reaper does not GET 2017-01-27 09:18:48 -05:00
Kubernetes Submit Queue 1625150de8 Merge pull request #40260 from liggitt/kubectl-tpr
Automatic merge from submit-queue (batch tested with PRs 39223, 40260, 40082, 40389)

make kubectl generic commands work with unstructured objects

part of making apply, edit, label, annotate, and patch work with third party resources

fixes #35149
fixes #34413

prereq of:
https://github.com/kubernetes/kubernetes/issues/35496
https://github.com/kubernetes/kubernetes/pull/40096

related to:
https://github.com/kubernetes/kubernetes/issues/39906
https://github.com/kubernetes/kubernetes/issues/40119

kubectl is currently decoding any resource it doesn't have compiled-in to a ThirdPartyResourceData struct, which means it computes patches using that struct, and would try to send a ThirdPartyResourceData object to the API server when running `apply`

This PR removes the behavior that decodes unknown objects into ThirdPartyResourceData structs internally, and fixes up the following generic commands to work with unstructured objects

- [x] apply
  - [x] decode into runtime.Unstructured objects
  - [x] successfully use `--record` with unregistered objects 
- [x] patch
  - [x] decode into runtime.Unstructured objects
  - [x] successfully use `--record` with unregistered objects 
- [x] describe
  - [x] decode into runtime.Unstructured objects
  - [x] implement generic describer
- [x] fix other generic kubectl commands to work with unstructured objects
  - [x] label
  - [x] annotate

follow-ups for pre-existing issues:
- [ ] `explain` doesn't work with unregistered resources
- [ ] remove special casing of federation group in clientset lookups, etc
- [ ] `patch`
  - [ ] doesn't honor output formats when persisting to server (`kubectl patch -f svc.json --type merge -p '{}' -o json` doesn't output json)
  - [ ] --local throws exception (`kubectl patch -f svc.json --type merge -p '{}' --local`)
- [ ] `apply`
  - [ ] fall back to generic JSON patch computation if no go struct is registered for the target GVK (e.g. https://github.com/kubernetes/kubernetes/pull/40096)
  - [ ] ensure subkey deletion works in CreateThreeWayJSONMergePatch
  - [ ] ensure type stomping works in CreateThreeWayJSONMergePatch
  - [ ] lots of tests for generic json patch computation
  - [ ] prevent generic apply patch computation among different versions
  - [ ] reconcile treatment of nulls with https://github.com/kubernetes/kubernetes/pull/35496
- [ ] `edit`
  - [ ] decode into runtime.Unstructured objects
  - [ ] fall back to generic JSON patch computation if no go struct is registered for the target GVK
2017-01-27 05:41:45 -08:00
Kubernetes Submit Queue 10e3edcaa4 Merge pull request #39223 from brendandburns/i18n
Automatic merge from submit-queue (batch tested with PRs 39223, 40260, 40082, 40389)

Add a script to extract strings for translation and a sample of it's output

@fabianofranz @deads2k @kubernetes/sig-cli-pr-reviews
2017-01-27 05:41:44 -08:00
Jordan Liggitt 408a978f26
fix --record to work with unstructured objects 2017-01-26 19:59:27 -05:00
Jordan Liggitt c317f92990
patch: allow --local to use structs for strategic merge, warn about unknown objects 2017-01-26 19:59:26 -05:00
Jordan Liggitt 424dac921f
Fall back to unstructured typer retrieving GVKs for printing 2017-01-26 19:59:26 -05:00
Jordan Liggitt aaf96a1048
apply: use unstructured objects 2017-01-26 19:59:26 -05:00
Jordan Liggitt d41e391799
describe: allow describing generic api objects 2017-01-26 19:59:26 -05:00
Jordan Liggitt 06c12f6716
describe: use unstructured objects 2017-01-26 19:59:25 -05:00
Jordan Liggitt b6d4f371cd
patch: use unstructured objects 2017-01-26 19:59:25 -05:00
Jordan Liggitt 89266588d1
label: use unstructured objects 2017-01-26 19:59:25 -05:00
Jordan Liggitt 9b60d7fd84
annotate: use unstructured objects 2017-01-26 19:59:24 -05:00
Jordan Liggitt dd6d454848
kubectl: remove ThirdPartyResourceData behavior for unregistered objects 2017-01-26 19:59:24 -05:00
Jordan Liggitt a82c4481f3
Distinguish between client and unstructuredclient in fake factory 2017-01-26 19:59:16 -05:00
Jordan Liggitt a57307a429
bazel 2017-01-26 19:59:16 -05:00
Kubernetes Submit Queue e3a3743410 Merge pull request #40073 from matthyx/master
Automatic merge from submit-queue (batch tested with PRs 40046, 40073, 40547, 40534, 40249)

Issue #13501 - printEvent Source to much more cleaner

Create a formatEventSource func and use it.



**What this PR does / why we need it**:
Adds a smarter way to print EventSource, removing "{ }" and the eventual extra ", " when Host is empty.
It was also reported in OpenShift issue https://github.com/openshift/origin/issues/6586

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

**Special notes for your reviewer**:
I have used this new func in all user facing printouts, but there are other places where EventSource are printed to logs, like DumpEventsInNamespace in test/e2e/framework/util.go for instance.
Don't know if I should correct there too...

**Release note**:

```release-note
Improve formatting of EventSource in kubectl get and kubectl describe
```
2017-01-26 16:10:36 -08:00
Kubernetes Submit Queue bef60b8602 Merge pull request #40046 from juanvallejo/jvallejo/update-multiple-types-requested-check
Automatic merge from submit-queue (batch tested with PRs 40046, 40073, 40547, 40534, 40249)

update check for "all" resources

This patch updates the check for `all` resources to handle cases where a resource's name is "all". Rather than cycling through all given args until `all` is found, this patch makes sure that only a single argument `all` was specified at all.

**Release note**:
```release-note
release-note-none
```

@fabianofranz @pwittrock
2017-01-26 16:10:34 -08:00
Kubernetes Submit Queue aace5a7b87 Merge pull request #40449 from deads2k/client-15-types
Automatic merge from submit-queue (batch tested with PRs 40239, 40397, 40449, 40448, 40360)

move the discovery and dynamic clients

Moved the dynamic client, discovery client, testing/core, and testing/cache to `client-go`.  Dependencies on api groups we don't have generated clients for have dropped out, so federation, kubeadm, and imagepolicy.

@caesarxuchao @sttts 

approved based on https://github.com/kubernetes/kubernetes/issues/40363
2017-01-26 14:23:42 -08:00
deads2k 9488e2ba30 move testing/core to client-go 2017-01-26 13:54:40 -05:00
Kubernetes Submit Queue 122bf004bf Merge pull request #38987 from seeekr/patch-2
Automatic merge from submit-queue

fix typo in describe.go

**What this PR does / why we need it**: fixes typo in `kubectl describe nodes` command

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-26 06:31:57 -08:00
deads2k 2734f8f892 move dynamic and discovery clients 2017-01-26 08:37:06 -05:00
Kubernetes Submit Queue cd4b9ca079 Merge pull request #40500 from kubernetes/revert-40359-owners-01-kubectl
Automatic merge from submit-queue

Revert "update kubectl approvers"

Reverts kubernetes/kubernetes#40359
2017-01-26 05:05:05 -08:00
Matthias Bertschy 42eb8ff0e7 Issue #13501 - create a formatEventSource func and use it. 2017-01-26 08:23:44 +01:00
Brendan Burns e8b0f59ed2 Add a script to extract strings for translation and a sample of what it does. 2017-01-25 22:08:02 -08:00
Kubernetes Submit Queue a931b7e238 Merge pull request #40357 from sttts/sttts-more-cutoffs-2
Automatic merge from submit-queue (batch tested with PRs 39538, 40188, 40357, 38214, 40195)

genericapiserver: cut off more dependencies – episode 2

Compare commit subjects.

approved based on #40363
2017-01-25 17:47:13 -08:00
grodrigues3 61e9454883 Revert "update kubectl approvers" 2017-01-25 17:32:22 -08:00
Dr. Stefan Schimanski a0137e9b28 Update generated files 2017-01-25 19:49:45 +01:00
Dr. Stefan Schimanski d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
Kubernetes Submit Queue 90b5d4cbd8 Merge pull request #40421 from liggitt/revert-configmapedit
Automatic merge from submit-queue (batch tested with PRs 38905, 40421)

Revert "Add the ability to edit fields within a config map."

Fixes #40396 
This reverts commit 31eca372c9.

#38445 broke edit for all resources other than configmaps:
```
$ kubectl edit serviceaccount default
Error from server (NotFound): configmaps "serviceaccount" not found
```
also, `edit` is a generic command, we can't add subcommands that claim the `configmap` space and mess with the things resourcebuilder accepts
2017-01-25 09:49:49 -08:00
Kubernetes Submit Queue ebbf3a9383 Merge pull request #40359 from deads2k/owners-01-kubectl
Automatic merge from submit-queue

update kubectl approvers

All the other owners files have names (not groups).  Updated for individual users for approvers so `/approve` works.

@kubernetes/sig-cli-api-reviews
2017-01-25 08:17:26 -08:00
Kubernetes Submit Queue 5c5ce3baee Merge pull request #40362 from deads2k/client-14-move-pkgs
Automatic merge from submit-queue

move client/cache and client/discovery to client-go

mechanical changes to move those packages.  Had to create a `k8s.io/kubernetes/pkg/client/tests` package for tests that were blacklisted from client-go.  We can rewrite these tests later and move them, but for now they'll still run at least.

@caesarxuchao @sttts
2017-01-25 08:17:15 -08:00
Kubernetes Submit Queue 748fb52cd5 Merge pull request #40416 from kargakis/kubectl-deployment-fix
Automatic merge from submit-queue (batch tested with PRs 40130, 40419, 40416)

kubectl: update deployment describer to correctly show total replicas

@kubernetes/sig-cli-misc
2017-01-25 07:22:59 -08:00
juanvallejo 1b8f4e0b7d update check for "all" resources 2017-01-25 10:15:29 -05:00
Kubernetes Submit Queue baaaf26609 Merge pull request #40130 from xilabao/change-to-v1beta1-in-create-rolebinding
Automatic merge from submit-queue

change APIVersion to v1beta1 in create rolebinding/clusterrolebinding
2017-01-25 06:51:33 -08:00
deads2k ce17351ca6 update kubectl approvers 2017-01-25 09:39:23 -05:00
Jordan Liggitt 83e06d9fd1
Revert "Add the ability to edit fields within a config map."
This reverts commit 31eca372c9.
2017-01-25 09:12:32 -05:00
deads2k 502bfdf944 client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
Michail Kargakis e7a2b3e43a kubectl: update deployment describer to correctly show total replicas 2017-01-25 11:30:11 +01:00
Kubernetes Submit Queue df42444742 Merge pull request #40216 from sttts/sttts-more-cutoffs
Automatic merge from submit-queue (batch tested with PRs 39260, 40216, 40213, 40325, 40333)

genericapiserver: more dependency cutoffs

- cut-off pkg/api.Resource and friends - lgtm
- authn plugins -> k8s.io/apiserver - 
- webhook authz plugin -> k8s.io/apiserver - lgtm
- ~~pkg/cert -> k8s.io/apimachinery (will rebase on @deads2k's PR also moving it)~~
- split pkg/config into kubelet config merger and flags - lgtm
- split feature gate between generic apiserver and kube - lgtm
- move pkg/util/flag into k8s.io/apiserver - lgtm
2017-01-24 16:26:00 -08:00
Dr. Stefan Schimanski 2b8e938128 Update generated files 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 82826ec273 pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
Clayton Coleman be6d2933df
refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Kubernetes Submit Queue 43286a82c6 Merge pull request #39981 from fraenkel/optional_configmaps_secrets
Automatic merge from submit-queue

Optional configmaps and secrets

Allow configmaps and secrets for environment variables and volume sources to be optional

Implements approved proposal c9f881b7bb

Release note:
```release-note
Volumes and environment variables populated from ConfigMap and Secret objects can now tolerate the named source object or specific keys being missing, by adding `optional: true` to the volume or environment variable source specifications.
```
2017-01-23 23:06:35 -08:00
Kubernetes Submit Queue f545d6ad47 Merge pull request #40057 from MrHohn/kubectl-create-seletor
Automatic merge from submit-queue (batch tested with PRs 40328, 40057)

Allows kubectl create -f to filter by selector.

From #32544.

The underlying `seletor` infrastructrue was implemented by #32599. The test is basically copy-paste of the corresponding test for `kubectl apply -f -l`.

```release-note
kubectl create now accepts the label selector flag for filtering objects to create
```
2017-01-23 22:19:11 -08:00
Michael Fraenkel 4e466040d9 Allow Optional ConfigMap and Secrets
- ConfigMaps and Secrets for Env or Volumes are allowed to be optional
2017-01-23 18:59:49 -07:00
xilabao d969edebe5 change APIVersion to v1beta1 in create rolebinding/clusterrolebinding 2017-01-24 08:32:56 +08:00
Clayton Coleman 9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Kubernetes Submit Queue 5ea80569ae Merge pull request #40227 from deads2k/client-11-easy
Automatic merge from submit-queue

make client-go tools/auth and tools/clientcmd authoritative

These moved easily.  Pure mechanical.  I'll have a couple snip pulls for some of the more complicated packages.  `pkg/util/homedir` was a transitive that moved with. It was only used in `kubectl` and you'd need it to be consistent with `clientcmd` loading order.

@sttts
2017-01-23 09:07:17 -08:00
Kubernetes Submit Queue 1f1f3692bd Merge pull request #38445 from brendandburns/configmap2
Automatic merge from submit-queue (batch tested with PRs 38445, 40292)

Add the ability to edit fields within a config map.

Addresses part of https://github.com/kubernetes/kubernetes/issues/36222

Example command:

```console
$ kubectl edit configmap foo --config-map-data=bar
```

Will open the data element named `bar` in the `ConfigMap` named `foo` in `$EDITOR`, the edited contents are then updated back to the config map.

@kubernetes/sig-cli 

```release-note
Add a special purpose tool for editing individual fields in a ConfigMap with kubectl
```
2017-01-23 08:11:06 -08:00
deads2k 335ef747d6 mechanical 2017-01-23 10:03:55 -05:00
xilabao 93c63d76e8 fix --save-config in create subcommand 2017-01-23 15:15:37 +08:00
Kubernetes Submit Queue 6b293d4c13 Merge pull request #40242 from mikedanese/csr-get-help
Automatic merge from submit-queue (batch tested with PRs 40120, 40242)

add csr to kubectl get help
2017-01-20 16:25:46 -08:00
Kubernetes Submit Queue ffb2dc2e02 Merge pull request #40187 from tianshapjq/adjust-delete-pod-uid-helpinfo
Automatic merge from submit-queue (batch tested with PRs 40187, 40231, 40152)

remove the delete-pod-uid spec

**What this PR does / why we need it**:
remove the specifications about "kubectl delete pod uid" cause it's no longer supported.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #40121
2017-01-20 13:29:45 -08:00
Mike Danese e1491aa788 add csr to kubectl get help 2017-01-20 13:14:51 -08:00
Kubernetes Submit Queue 85d328f8da Merge pull request #40189 from xilabao/patch-5
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

update short help message in set resource

To keep the help message well-formed.
```
#kubectl set -h           
Configure application resources 

These commands help you make changes to existing application resources.

Available Commands:
  image       Update image of a pod template
  resources   update resource requests/limits on objects with pod templates
  selector    Set the selector on a resource

Usage:
  kubectl set SUBCOMMAND [options]
```

```release-note
NONE
```
2017-01-20 12:34:59 -08:00
Kubernetes Submit Queue b5929bfb2b Merge pull request #38789 from jessfraz/cleanup-temp-dirs
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

Cleanup temp dirs

So funny story my /tmp ran out of space running the unit tests so I am cleaning up all the temp dirs we create.
2017-01-20 12:34:58 -08:00
deads2k 9c6a522882 mechanical results of client auth plugin 2017-01-20 08:05:18 -05:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
deads2k c587b8a21e re-run client-gen 2017-01-20 08:02:36 -05:00
Kubernetes Submit Queue 71802d2dc1 Merge pull request #40023 from soltysh/completions_boilerplate
Automatic merge from submit-queue (batch tested with PRs 39446, 40023, 36853)

Allow setting copyright header file for generated completions

This PR allows downstream vendors (like openshift) to generate completions with custom header, similarly to other generated code.

@fabianofranz ptal
@kubernetes/sig-cli-misc fyi
2017-01-19 18:53:47 -08:00
xilabao 5b3d59c235 update short help message in set resource 2017-01-19 18:53:43 -06:00
tianshapjq 69946cf886 remove the delete-pod-uid spec 2017-01-20 08:16:20 +08:00
Michael Fraenkel 13d693d220 Secrets can populate environment variables 2017-01-19 13:46:05 -05:00
Kubernetes Submit Queue e9d4e4341c Merge pull request #40087 from deads2k/generic-24-move-fields
Automatic merge from submit-queue

move pkg/fields to apimachinery

Purely mechanical move of `pkg/fields` to apimachinery.  

Discussed with @lavalamp on slack.  Moving this an `labels` to apimachinery.

@liggitt any concerns?  I think the idea of field selection should become generic and this ends up shared between client and server, so this is a more logical location.
2017-01-19 08:48:17 -08:00
Kubernetes Submit Queue 05c2a0825e Merge pull request #38871 from k82cn/k8s_25318
Automatic merge from submit-queue

Made multi-scheduler graduated to Beta and then v1.

fixes #25318
2017-01-19 07:58:51 -08:00
Maciej Szulik 56147c5174 Allow setting copyright header file for generated completions 2017-01-19 16:06:20 +01:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
juanvallejo 78ccf2dd52 Add printer#EnsurePrintHeaders method
This patch adds a new `EnsurePrintHeaders` method to the
HumanReadablePrinter `ResourcePrinter`, which allows headers to be
printed in cases where multiple lists of the same resource are printed
consecutively, but are separated by non-printer related information.
2017-01-19 09:39:55 -05:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
deads2k 6c6616b41c move restclient/watch 2017-01-19 07:39:20 -05:00
deads2k cdb2934bbc remove kubernetes copy of clientcmd types 2017-01-19 07:39:19 -05:00
Klaus Ma c8c4b81963 Made multi-scheduler graduated to Beta and then v1. 2017-01-19 20:16:01 +08:00
Kubernetes Submit Queue 723fa08767 Merge pull request #39324 from wojtek-t/change_patch_api
Automatic merge from submit-queue

Prepare for using optimized conversion to/from map[string]interface{} in Patch operation

Ref #39017
2017-01-19 00:50:12 -08:00
Kubernetes Submit Queue 4520819df7 Merge pull request #39042 from juanvallejo/jvallejo/dont-filter-pods-if-json-or-yaml
Automatic merge from submit-queue (batch tested with PRs 36467, 36528, 39568, 40094, 39042)

do not filter kubectl get pods if -o json or yaml

Fixes: https://github.com/kubernetes/kubernetes/issues/38327

This patch sets the value of --show-all to true if the output format
specified is 'json' or 'yaml'.

**Release note**:
```release-note
release-note-none
```

@smarterclayton
2017-01-18 13:37:13 -08:00
juanvallejo 713df3d74e
remove check for multiple resource types 2017-01-18 13:26:13 -05:00
Jordan Liggitt e49554501f
Use versioned Taint/Toleration/AllowPods objects when marshalling 2017-01-18 12:52:14 -05:00
Kubernetes Submit Queue 788804142f Merge pull request #39036 from juanvallejo/jvallejo/do-not-list-deleted-pull-secrets
Automatic merge from submit-queue (batch tested with PRs 40038, 40041, 39036)

don't show deleted pull secrets - kubectl describe

This patch filters out any image pull secrets that have been deleted
when printing the describer output for a service account.

Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1403376

**Release note**:
```release-note
release-note-none
```

@fabianofranz @AdoHe
2017-01-18 08:37:54 -08:00
Wojciech Tyczynski d08abdb187 Allow for returning map[string]interface{} from patch. 2017-01-18 11:53:30 +01:00
Zihong Zheng 6b9860cf54 Allows kubectl create -f to filter by selector. 2017-01-17 19:18:51 -08:00
juanvallejo 430283b973 add OutputsRawFormat helper; default show-all on multiple resource kinds 2017-01-17 17:07:35 -05:00
Clayton Coleman bcde05753b
Correct import statements 2017-01-17 16:18:18 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Clayton Coleman 36acd90aba
Move APIs and core code to use metav1.ObjectMeta 2017-01-17 16:17:18 -05:00
Kubernetes Submit Queue 65f6875ec4 Merge pull request #34763 from juanvallejo/jvallejo/add-warning-on-export-invalid-output-version
Automatic merge from submit-queue

log info on invalid --output-version

**Release note**:

``` release-note
release-note-none
```

Object versions default to the current version (v1) when a specified
`--output-version` is invalid. This patch logs a warning when this is
the case. Cases affected are all commands with the `--output-version`
option, and anywhere runtime objects are converted to versioned objects.

**Example**

```
$ kubectl get pod <mypod> -o json --output-version=invalid
W1013 17:24:16.810278   26719 result.go:238]  info: the output version
specified (invalid) is invalid, defaulting to v1
{
        "kind": "Pod",
            "apiVersion": "v1",
                "metadata": {
                            "name": "mypod",
                                    "namespace": "test",
...
```
2017-01-17 09:01:31 -08:00
Kubernetes Submit Queue f7305e6f43 Merge pull request #39974 from deads2k/api-60-move-patch
Automatic merge from submit-queue

Move PatchType to apimachinery/pkg/types

Fixes https://github.com/kubernetes/kubernetes/issues/39970

`PatchType` is shared by the client and server, they have to agree, and its critical for our API to function.

@smarterclayton @kubernetes/sig-api-machinery-misc
2017-01-17 07:29:06 -08:00
Kubernetes Submit Queue 3aa29bca4f Merge pull request #40009 from kargakis/fix-dryrun-for-rollout
Automatic merge from submit-queue (batch tested with PRs 39911, 40002, 39969, 40012, 40009)

kubectl: fix rollback dryrun when version is not specified

@kubernetes/sig-cli-misc
2017-01-17 06:47:00 -08:00
juanvallejo e796ea28b9 don't show deleted pull secrets - kubectl describe
This patch appends "(not found)" to any image pull secrets that are
present in a service account, but no longer present in the namespace.
2017-01-17 09:38:50 -05:00
deads2k f31ecdd0f7 generated changes 2017-01-17 08:32:05 -05:00
deads2k 26c46971f2 move PatchType to apimachinery 2017-01-17 08:32:05 -05:00
Dr. Stefan Schimanski 52f6831576 genericapiserver: cut off kube pkg/version dependency 2017-01-17 12:34:05 +01:00
Michail Kargakis 9c820a5793 kubectl: fix rollback dryrun when version is not specified 2017-01-17 12:01:09 +01:00
Maciej Szulik 4a0c9fa536 Fix ScheduledJob -> CronJob rename leftovers 2017-01-17 09:24:07 +01:00
Kubernetes Submit Queue 4937b05a46 Merge pull request #39853 from xingzhou/typo
Automatic merge from submit-queue

Fixed typo.
2017-01-16 20:44:43 -08:00
Kubernetes Submit Queue 6fe8ed738d Merge pull request #39401 from AdoHe/delete_refactor
Automatic merge from submit-queue (batch tested with PRs 39806, 39887, 39401)

refactor delete to remove cobra dependency

FYI. As part of CLI Q1 roadmap, we would like to reduce the dependency of Cobra from actual commands implementations. In this PR, I tried to refactor delete command to achieve this. @kubernetes/sig-cli-misc a quick review is quite welcome, and I am just working on more PRs.
2017-01-16 13:41:36 -08:00
Kubernetes Submit Queue adbf6c6eb6 Merge pull request #39887 from juanvallejo/jvallejo/export-list-of-user-resources
Automatic merge from submit-queue (batch tested with PRs 39806, 39887, 39401)

export list of user resources

This patch exports the list of "userResources" found in
`pkg/kubectl/cmd/util/shortcut_resmapper.go` to allow its use in
external packages and clients.

Related downstream PR: https://github.com/openshift/origin/pull/12147

**Release note**:
```release-note
release-note-none
```

cc @deads2k
2017-01-16 13:41:35 -08:00
Kubernetes Submit Queue 6defc30337 Merge pull request #39882 from deads2k/api-59-errors
Automatic merge from submit-queue (batch tested with PRs 38592, 39949, 39946, 39882)

move api/errors to apimachinery

`pkg/api/errors` is a set of helpers around `meta/v1.Status` that help to create and interpret various apiserver errors.  Things like `.NewNotFound` and `IsNotFound` pairings.  This pull moves it into apimachinery for use by the clients and servers.

@smarterclayton @lavalamp First commit is the move plus minor fitting.  Second commit is straight replace and generation.
2017-01-16 10:37:42 -08:00
Kubernetes Submit Queue aef113454f Merge pull request #39936 from xilabao/patch-4
Automatic merge from submit-queue (batch tested with PRs 39947, 39936, 39902, 39859, 39915)

fix example in set selector
2017-01-16 09:26:14 -08:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Dr. Stefan Schimanski 918868b115 genericapiserver: cut off certificates api dependency 2017-01-16 14:10:59 +01:00
xilabao 8acbbb21e1 fix example in set selector
example run failed
2017-01-16 01:55:30 -06:00
AdoHe d6d82425a4 refactor delete to remove cobra dependency 2017-01-15 15:30:06 +08:00
Brendan Burns 31eca372c9 Add the ability to edit fields within a config map. 2017-01-14 21:12:27 -08:00
Kubernetes Submit Queue a6fa5c2bfd Merge pull request #39814 from deads2k/api-58-multi-register
Automatic merge from submit-queue

replace global registry in apimachinery with global registry in k8s.io/kubernetes

We'd like to remove all globals, but our immediate problem is that a shared registry between k8s.io/kubernetes and k8s.io/client-go doesn't work.  Since client-go makes a copy, we can actually keep a global registry with other globals in pkg/api for now.

@kubernetes/sig-api-machinery-misc @lavalamp @smarterclayton @sttts
2017-01-13 12:37:02 -08:00
juanvallejo 95437a941f export list of user resources
This patch exports the list of "userResources" found in
`pkg/kubectl/cmd/util/shortcut_resmapper.go` to allow its use in
external packages and clients.
2017-01-13 14:48:47 -05:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
Xing Zhou 695c27287b Fixed typo.
Fixed variable sequence typo in kubectl create sub-command tests.
2017-01-13 12:54:15 +08:00
Robert Rati 6a3ad93d6c [scheduling] Moved pod affinity and anti-affinity from annotations to api
fields. #25319
2017-01-12 14:54:29 -05:00
Kubernetes Submit Queue e73d66ce44 Merge pull request #37557 from sttts/sttts-update-ugorji
Automatic merge from submit-queue

Update ugorji/go/codec godep

In order to pick-up https://github.com/ugorji/go/issues/119 and to get rid of the workaround at https://github.com/kubernetes/kubernetes/pull/36909/files#diff-a09eb061a0fb0ef3c9ef9d696f1ad0b4R426.
2017-01-12 02:36:16 -08:00
Janet Kuo a8e92e6f2a Fix bug when printing replicas in Deployment Describer 2017-01-11 17:26:01 -08:00
Dr. Stefan Schimanski 2741eb7fdb Update generated files 2017-01-11 21:54:07 +01:00
juanvallejo 9c7b5c3425 log info on invalid --output-version
Object versions default to the current version (v1) when a specified
`--output-version` is invalid. This patch logs a warning when this is
the case. Cases affected are all commands with the `--output-version`
option, and anywhere runtime objects are converted to versioned objects.

**Example**
```
$ kubectl get pod <mypod> -o json --output-version=invalid
W1013 17:24:16.810278   26719 result.go:238]  info: the output version
specified (invalid) is invalid, defaulting to v1
{
        "kind": "Pod",
            "apiVersion": "v1",
                "metadata": {
                            "name": "mypod",
                                    "namespace": "test",
...
```
2017-01-11 13:12:33 -05:00
Kubernetes Submit Queue 6e5b455b77 Merge pull request #39038 from ncdc/fix-kubectl-get-list
Automatic merge from submit-queue

Fix kubectl get -f <file> -o <nondefault printer> so it prints all items in the file

**What this PR does / why we need it**: Fix kubectl get -f <file> -o <nondefault printer> so it prints all the objects in the file, instead of just the first one. Also add a test for this feature.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

cc @AdoHe @deads2k @liggitt @fabianofranz @kubernetes/kubectl @kubernetes/sig-cli-misc
2017-01-11 09:58:38 -08:00
Andy Goldstein 613ada4cd7 Fix kubectl get -f <file> -o <nondefault printer>
Fix kubectl get -f <file> -o <nondefault printer> so it prints all the
objects in the file, instead of just the first one. Also add a test for
this feature.
2017-01-11 10:30:13 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue 3f9f7471af Merge pull request #38989 from sjenning/set-qos-field
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

Set PodStatus QOSClass field

This PR continues the work for https://github.com/kubernetes/kubernetes/pull/37968

It converts all local usage of the `qos` package class types to the new API level types (first commit) and sets the pod status QOSClass field in the at pod creation time on the API server in `PrepareForCreate` and in the kubelet in the pod status update path (second commit).  This way the pod QOS class is set even if the pod isn't scheduled yet.

Fixes #33255

@ConnorDoyle @derekwaynecarr @vishh
2017-01-10 22:24:13 -08:00
Kubernetes Submit Queue 748e8f6b1c Merge pull request #39540 from pwittrock/kubectldocs
Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686)

Improve kubectl help with examples.

```release-note
NONE
```
2017-01-10 20:38:19 -08:00
Kubernetes Submit Queue 4d9bd12cac Merge pull request #39536 from screeley44/add-storage-class
Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686)

Adding storageclass to resource printers for get pv and pvc

Give ability to see what Storage Class a PV is using, as well as what StorageClass a PVC has requested

```
[root@screeley-sc1 gce]# kubectl get pv
NAME                                       CAPACITY   ACCESSMODES   RECLAIMPOLICY   STATUS      CLAIM                            STORAGECLASS   REASON    AGE
pv-gce                                     2Gi        RWO           Retain          Available                                    anything                 41m
pvc-774217fd-d440-11e6-9d11-42010af00010   2Gi        RWO           Delete          Bound       default/gce-claim-storageclass   slow                     0s

[root@screeley-sc1 gce]# kubectl get pvc
NAME                              STATUS    VOLUME                                     CAPACITY   ACCESSMODES   REQUESTEDSTORAGECLASS   AGE
gce-claim-class1                  Pending                                                                                      		6m
gce-claim-classless               Pending                                                                                      		6m
gce-claim-storageclass            Bound     pvc-774217fd-d440-11e6-9d11-42010af00010   2Gi        RWO           slow           		6m
gce-claim-storageclass-nonexist   Pending                                                                       superfly       		4s
```
@kubernetes/sig-storage
2017-01-10 20:38:15 -08:00
Kubernetes Submit Queue dd544bb950 Merge pull request #37288 from juanvallejo/jvallejo/update-quota-scope-descriptions
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Update quota scope descriptions

```release-note
release-note-none
```

This patch improves the help text descriptions for quota scopes.

@kubernetes/kubectl
2017-01-10 14:33:12 -08:00
Kubernetes Submit Queue 9ef9630976 Merge pull request #39486 from ncdc/allow-missing-keys-in-templates
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Allow missing keys in templates by default

Switch to allowing missing keys in jsonpath templates by default.

Add support for allowing/disallowing missing keys in go templates
(default=allow).

Add --allow-missing-template-keys flag to control this behavior (default=true /
allow missing keys).

Fixes #37991

@kubernetes/sig-cli-misc @kubernetes/api-reviewers @smarterclayton @fabianofranz @liggitt @pwittrock
2017-01-10 14:33:10 -08:00
Seth Jennings e2402b781b set qos class field in pod status 2017-01-10 16:31:52 -06:00
juanvallejo cade00e646
do not filter kubectl get pods if -o json or yaml
This patch sets the value of --show-all to true if the output format
specified is 'json' or 'yaml'.
2017-01-10 14:42:38 -05:00
Kubernetes Submit Queue ee177dbbfe Merge pull request #38866 from xingzhou/kube-25579
Automatic merge from submit-queue (batch tested with PRs 37845, 39439, 39514, 39457, 38866)

Add software versions to "kubectl get nodes -o wide" output.

Added "OS-IMAGE" and "KERNEL-VERSION" two columns to
"kubectl get nodes -o wide" output. This will help to provide
more information for user to locate or debug issues. See discussion
in ticket #25579
2017-01-09 13:15:21 -08:00
juanvallejo 134cada45f Update quota scope descriptions 2017-01-09 11:35:54 -05:00
Scott Creeley 79fea8857d Adding storageclass to resource printers 2017-01-09 10:57:28 -05:00
Andy Goldstein 80c5cd8b88 Allow missing keys in templates by default
Switch to allowing missing keys in jsonpath templates by default.

Add support for allowing/disallowing missing keys in go templates
(default=allow).

Add --allow-missing-template-keys flag to control this behavior
(default=true / allow missing keys).
2017-01-09 10:35:46 -05:00
Xing Zhou 5edac7c575 Add software versions to "kubectl get nodes -o wide" output.
Added "OS-IMAGE" and "KERNEL-VERSION" two columns to
"kubectl get nodes -o wide" output. This will help to provide
more information for user to locate or debug issues. See discussion
in ticket #25579
2017-01-09 03:06:28 +00:00
Clayton Coleman c5d755dbec
Refactor tests to match new versioned code structure 2017-01-06 23:45:03 -05:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Phillip Wittrock dc2fffe5d4 Improve kubectl help with examples. 2017-01-06 13:35:43 -08:00
Kubernetes Submit Queue fd3498483b Merge pull request #38835 from p0lyn0mial/shortcutexpander_take_res_from_hardcoded
Automatic merge from submit-queue

ShortcutExpander has been extended in a way that it will examine a ha…

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

ShortcutExpander has been extended in a way that it will examine a hardcoded list of tuples anticipated from the server when searching for an alternative name for the resource.

Note that the list is ordered and the first match will yield the extended resource's name.

One important thing to highlight is that the ShortcutExpander will fall back to PriorityRestMaper to determine the group for the resource.

Also this PR introduces a new shortcut namely sc which will resolve to storageclasses within storage.k8s.io group


**Special notes for your reviewer**: You might want to see https://github.com/kubernetes/kubernetes/pull/38755

**Release note**:

```release-note
```
2017-01-06 10:36:01 -08:00
Kubernetes Submit Queue 0d93a4c360 Merge pull request #39428 from shiywang/refactor_wideColumns_printer
Automatic merge from submit-queue (batch tested with PRs 39132, 39428)

Move wideHeader [] strings into handlerEntry

To adress this problem: https://github.com/openshift/origin/pull/12354, make `-o wide` more flexible to be used by OpenShift
2017-01-06 09:53:20 -08:00
shiywang 31c4d158af move wideHeader string into handlerEntry
change var name, remove formatWideHeaders()

go fmt
2017-01-06 14:20:50 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Kubernetes Submit Queue acc81d6d96 Merge pull request #39291 from xilabao/fix-set-selector
Automatic merge from submit-queue (batch tested with PRs 38766, 39291)

fix kubectl set selector

fix #39290
2017-01-05 03:36:18 -08:00
Kubernetes Submit Queue 51e6c879e7 Merge pull request #39226 from luksa/kubectl_proxy_empty_path
Automatic merge from submit-queue (batch tested with PRs 39311, 39226, 39445)

Make kubectl proxy accept empty path

**What this PR does / why we need it**:
The kubectl proxy previously returned 403 Forbidden: Unauthorized when receiving a request from e.g. "curl localhost:8001" or "curl localhost:8001/".  The previous DefaultPathAcceptRE regex was wrong as it assumed the path in this case would be "/" (but it is actually "").

After someone runs kubectl proxy and tries accessing it with curl, they will probably just try hitting localhost:8001  (which returns an "Unauthorized" response) instead of say localhost:8001/api (which returns a proper response from the API server). Also, whoever previously modified the DefaultPathAcceptRE regex was obviously expecting the regex to accept requests for localhost:8001/

```release-note
fix issue with kubectl proxy so that it will proxy an empty path - e.g. http://localhost:8001
```
2017-01-04 18:25:07 -08:00
Jess Frazelle b5da2d13a6
cleanup dataXXX in /tmp
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:27:06 -08:00
Kubernetes Submit Queue 17f8d82fa3 Merge pull request #39359 from tianshapjq/add-top-specification
Automatic merge from submit-queue

add some specifications on the top command

**What this PR does / why we need it**:
the top command is available when heapster works fine on the server, but the specifications doesn't mention about this. So I added some specifications here.
2017-01-04 08:45:54 -08:00
Kubernetes Submit Queue ee03b9b206 Merge pull request #39400 from xilabao/fix-wrong-help-message-for-taint
Automatic merge from submit-queue (batch tested with PRs 39409, 39400)

fix wrong help message for taint

fix #39381
2017-01-04 08:03:10 -08:00
Kubernetes Submit Queue 819535b96a Merge pull request #36245 from fraenkel/env_configmap
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Allow pods to define multiple environment variables from a whole ConfigMap

Allow environment variables to be populated from ConfigMaps

- ConfigMaps represent an entire set of EnvVars
- EnvVars can override ConfigMaps


fixes #26299
2017-01-03 23:28:09 -08:00
xilabao a8b15492b4 fix wrong help message for taint 2017-01-04 11:14:25 +08:00
xilabao 78a0fb1e5a fix kubectl set selector 2017-01-04 10:34:24 +08:00
tianshapjq 2c2dba67fd modify the specifications 2017-01-04 09:12:24 +08:00
Kubernetes Submit Queue 34ea3a17af Merge pull request #39001 from xilabao/fix-group-in-create-clusterrolebinding
Automatic merge from submit-queue

fix group in create clusterrolebinding

group lost.

```
#kubectl create clusterrolebinding test --clusterrole=a --group=b
clusterrolebinding "test" created

#kubectl get clusterrolebinding test -o yaml
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: 2016-12-20T03:13:24Z
  name: test
  resourceVersion: "284"
  selfLink: /apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindingstest
  uid: 44d3476d-c662-11e6-a439-7427ea6f0fe3
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: a
subjects: null
```
2017-01-03 16:49:24 -08:00
Kubernetes Submit Queue 3951ae4e1d Merge pull request #38112 from juanvallejo/jvallejo/add-output-format-support-kubectl-create
Automatic merge from submit-queue

Add json,yaml output format support to kubectl create, kubectl apply

Fixes: https://github.com/kubernetes/kubernetes/issues/37390

**Release note**:
```release-note
Added support for printing in all supported `--output` formats to `kubectl create ...` and `kubectl apply ...`
```

This patch adds the ability to specify an output format other than
"name" to `kubectl create ...`. It can be used in conjunction with the
`--dry-run` option. Converts unstructured objects into known types in
order to support all `--output` values.

The patch prints `*resource.Info`s returned by the server. If a resource does not yet exist (and the `--dry-run` option is not set), the resource is created and printed in the specified format.

@kubernetes/cli-review @fabianofranz
2017-01-03 14:18:33 -08:00
Kubernetes Submit Queue 2a89179046 Merge pull request #39070 from shiywang/remove_unused_param
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

remove unused parameter
2017-01-03 10:32:22 -08:00
Kubernetes Submit Queue 7a9dddbbfc Merge pull request #39126 from xilabao/update-prompt-in-create-rolebinding/clusterrolebinding
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

update prompt in create rolebinding/clusterrolebinding
2017-01-03 09:45:20 -08:00
Michael Fraenkel 2d803afc98 ConfigMaps populate environment variables 2017-01-03 11:02:15 -05:00
Kubernetes Submit Queue cfc3c4b9aa Merge pull request #39150 from kargakis/ignore-deleted-pods-in-rolling-updater
Automatic merge from submit-queue

kubectl: ignore deleted pods in the rolling updater

Fixes https://github.com/kubernetes/kubernetes/issues/37955

The Deployment controller already ignores deleted pods or more precisely the ReplicaSet controller ignores deleted pods ([pod classification](a30b6e2d16/pkg/controller/replicaset/replica_set.go (L600)) ignores [deleted pods](a30b6e2d16/pkg/controller/controller_ref_manager.go (L63))) and the Deployment controller reuses what's in the ReplicaSet status.

@kubernetes/sig-apps-misc @kubernetes/sig-cli-misc
2017-01-02 07:34:19 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 897c48e75f Merge pull request #39053 from tanshanshan/fix-help2
Automatic merge from submit-queue (batch tested with PRs 39053, 36446)

fix --no-header help description

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

the current description is
>  --no-headers=false: When using the default or custom-column output format, don't print headers.

but ,

>  kubectl get po

 the header has been printing , so  the default condition is printing headers.

> kubectl get po --no-headers=true

 the header  has been not printing

> kubectl get po --no-headers=false

 the header  has been printing

So , I  fixed the help description

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2016-12-28 19:07:04 -08:00
tianshapjq a153f6f885 add some specifications on the top command 2016-12-29 08:44:45 +08:00
Kubernetes Submit Queue 3a2492f4d6 Merge pull request #39218 from luksa/kubectl_top_short_forms
Automatic merge from submit-queue

Kubectl top now also accepts short forms for "node" and "pod" ("no", "po")

**What this PR does / why we need it**:
People are used to typing `kubectl get po` and will expect `kubectl top po` to also work (without having to type the full resource name).
2016-12-28 15:47:11 -08:00
Xing Zhou 4fcc770367 Add three more columns to `kubectl get deploy -o wide` output.
Added CONTAINER(S), IMAGE(S) and SELECTOR fields to the output
of `kubectl get deploy -o wide`.
2016-12-28 03:07:13 +00:00
Kubernetes Submit Queue 9ce8f10a4d Merge pull request #39172 from foxish/fix-help
Automatic merge from submit-queue

Add PDB to kubectl get --help.

**What this PR does / why we need it**: Adds PDB to kubectl get --help

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: Fixes https://github.com/kubernetes/kubernetes/issues/39100

**Release note**:

```release-note
NONE
```

/cc @saad-ali @mwielgus
2016-12-27 13:19:36 -08:00
Marko Luksa c0aa2767aa Make kubectl proxy accept empty path
The proxy previously returned 403 Forbidden: Unauthorized when receiving a request from e.g. "curl localhost:8001" or "curl localhost:8001/".  The previous DefaultPathAcceptRE regex was wrong as it assumed the path in this case would be "/" (but it is actually "").
2016-12-25 18:31:55 +01:00
andrewsykim b8311ec7f9 kubectl get hpa should how current replicas 2016-12-24 23:30:39 -05:00
Kubernetes Submit Queue 1ee7163308 Merge pull request #36802 from brendandburns/i18n
Automatic merge from submit-queue

Begin paths for internationalization in kubectl

This is just the first step, purposely simple so we can get the interface correct.

@kubernetes/sig-cli @deads2k
2016-12-24 13:09:12 -08:00
Marko Luksa 764e8bd6c6 Kubectl top now also accepts short forms for "node" and "pod" ("no" and "po") 2016-12-24 17:25:08 +01:00
Brendan Burns 277306449b Add initial translation support. 2016-12-23 20:45:52 -08:00
Kubernetes Submit Queue b3fb6cb5fb Merge pull request #35191 from SamiHiltunen/commas-in-secrets
Automatic merge from submit-queue

kubectl: commas in --from-literal on secret creation

Closes #35185

``` release-note
Fixes an issue where commas were not accepted in --from-literal flags when creating secrets. Passing multiple values separated by a comma in a single --from-literal flag is no longer supported. Please use multiple --from-literal flags to provide multiple values.
```
2016-12-23 08:04:50 -08:00
Kubernetes Submit Queue 5f0ece92de Merge pull request #39008 from brendandburns/unicode
Automatic merge from submit-queue

Support loading UTF16 files if a byte-order-mark is present

Add support in kubectl for loading UTF16 encoded files if they have a correct BOM (Byte-Order-Mark https://en.wikipedia.org/wiki/Byte_order_mark) at the beginning
of the file. Falls back on UTF8 encoding, if no understandable BOM is present.

Fixes part of https://github.com/kubernetes/kubernetes/issues/39007

@fabianofranz @deads2k @kubernetes/sig-cli-misc
2016-12-22 22:11:13 -08:00
Mayank Kumar 777977612b ReplicaSet has owner ref of the Deployment that created it 2016-12-22 16:45:50 -08:00
Anirudh 7f0bcb3688 Add PDB to kubectl get --help. 2016-12-22 14:47:11 -08:00
p0lyn0mial ad688d7761 ShortcutExpander has been extended in a way that it will examine a hardcoded list of tuples anticipated from the server when
searching for an alternative name for the resource. Note that the list is ordered and the first match will yield the extended resource's name.

One important thing to highlight is that the ShortcutExpander will fall back to PriorityRestMaper to determine the group for
the resource. Also this PR introduces a new shortcut namely sc which will resolve to storageclasses within storage.k8s.io group

In addition the type of kubectl.ShortForms has been changed to ResourceShortcuts struct. It has got a brand new name,
it was also extended and ordered by group.
2016-12-22 17:29:52 +01:00
Michail Kargakis 3ee150fcc0 kubectl: ignore deleted pods in the rolling updater 2016-12-22 14:26:17 +01:00
xilabao 528a8d7d52 update prompt in create rolebinding/clusterrolebinding 2016-12-22 11:33:49 +08:00
xilabao 6b19a711ec fix group in create clusterrolebinding 2016-12-22 10:14:11 +08:00
tanshanshan 565a53871d fix help 2016-12-22 09:48:24 +08:00
Brendan Burns 8e561d9ae7 Add support for loading utf16 files. 2016-12-21 14:57:26 -08:00
deads2k 8b25c21e79 add create rolebinding 2016-12-21 09:03:27 -05:00
Angus Salkeld 17a711d8fd Add new command "kubectl set selector" 2016-12-21 12:30:56 +01:00
Shiyang Wang 9d037a0ab6 remove unused parameter 2016-12-21 16:09:51 +08:00
Kubernetes Submit Queue 52df372f9b Merge pull request #35805 from dgoodwin/token-mgmt
Automatic merge from submit-queue

Implement kubeadm bootstrap token management

Creates bootstrap tokens as secrets per the specification in #30707 

_WARNING_: These are not currently hooked up to the discovery service or the token it creates.

Still TODO:
- [x] delete tokens
- [x] merge with #35144 and adopt it's testing approach
- [x] determine if we want wholesale json output & templating like kubectl (we do not have an API object with the data we want here) may require a bit of plumbing.
- [x] allow specifying a token duration on the CLI
- [x] allow configuring the default token duration
- [x] hook up the initial token created during init

Sample output:

```
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: f6dc69.c43e491752c4a0fd
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: 8fad2f.e7b78c8a5f7c7b9a
(root@centos1 ~) $ kubeadm token list  
Running pre-flight checks
ID        TOKEN                     EXPIRATION
44d805    44d805.a4e78b6cf6435e33   23h
4f65bb    4f65bb.d006a3c7a0e428c9   23h
6a086e    6a086e.2ff99f0823236b5b   23h
8fad2f    8fad2f.e7b78c8a5f7c7b9a   23h
f6dc69    f6dc69.c43e491752c4a0fd   23h
f81653    f81653.9ab82a2926c7e985   23h
```
2016-12-20 14:44:40 -08:00
Kubernetes Submit Queue cc215202f2 Merge pull request #38929 from soltysh/cronjob_gen_test
Automatic merge from submit-queue

Add test for CronJob generator

Per @janetkuo request this was split from #38614, it adds test for `CronJob` generator, and additionally copy labels to `JobTemplate`, to be consistent with how `Job` generator works.
2016-12-20 14:04:20 -08:00
Devan Goodwin bfe345dd86 Implement kubeadm bootstrap token management.
Adds kubeadm subcommands to create, list, and delete bootstrap tokens.
Tokens can be created with a TTL duration, or 0 for tokens that will not
expire. The create command can also be used to specify your own token
(for use when bootstrapping masters and nodes in parallel), or update an
existing token's secret or ttl.

Marked "ex" for experimental for now as the boostrap controllers are not
yet hooked up in core.
2016-12-20 11:43:55 -04:00
Maciej Szulik 4855ae2e84 Add test for CronJob generator 2016-12-20 10:00:00 +01:00
Kubernetes Submit Queue 874fca652d Merge pull request #38086 from tianshapjq/reduce-decode-times
Automatic merge from submit-queue

Reduce decode times by changing the kubectl.Filter(runtime.Object, *PrintOptions)'s return values

**What this PR does / why we need it**:
In kubectl/cmd/get.go, we use the function filterFuncs.Filter() to decode data and filter the object. But in the following function printer.PrintObj() decodes the data again.
I made these modifications to reduce the decoding times by changing the filterFuncs.Filter()'s returned values. We can get the decoded object from this function and pass it to the following printer.PrintObj(), so not to waste time to decode again.
2016-12-19 16:23:02 -08:00
Denis Andrejew e8fa6cddfd fix typo in describe.go 2016-12-19 20:27:14 +00:00
Kubernetes Submit Queue d6046aab0e Merge pull request #38903 from deads2k/cli-16-fix-generic-create
Automatic merge from submit-queue (batch tested with PRs 38080, 38903)

prevent negotation on connections that dont' require it

Not all clientconfigs require negotiation.  Before there was a patch (hardcoded to an instance variable) that allowed this.  This updates the code to allow the same as before.

@kubernetes/sig-cli @fabianofranz

@ncdc you'll want to pick
2016-12-19 07:42:45 -08:00
Maciej Szulik cdec94523e Remove extensions/v1beta1 Job - generated changes 2016-12-17 00:07:25 +01:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
deads2k 9b507e8603 prevent negotation on connections that dont' require it 2016-12-16 16:26:55 -05:00
Robert Rati 91931c138e [scheduling] Moved node affinity from annotations to api fields. #35518 2016-12-16 11:42:43 -05:00
Kubernetes Submit Queue 0d80ee0b8d Merge pull request #38767 from kargakis/fix-setting-container-name-in-create-deployment
Automatic merge from submit-queue

kubectl: fix 'create deployment' to set container name correctly

@kubernetes/kubectl @kubernetes/sig-cli
2016-12-16 04:38:22 -08:00
Kubernetes Submit Queue e2a9fc1022 Merge pull request #38841 from mikedanese/fix-tests
Automatic merge from submit-queue

bazel: fix some unit tests
2016-12-15 20:19:46 -08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
tianshapjq 1453cd6264 reduce decoding times by changing kubectl.Filter(runtime.Object, *PrintOptions)'s return value 2016-12-16 09:37:11 +08:00
deads2k 50f6733800 make kubectl factory rings 2016-12-15 15:18:16 -05:00
Kubernetes Submit Queue db867c0c9d Merge pull request #36396 from aveshagarwal/master-display-pod-node-selectors
Automatic merge from submit-queue (batch tested with PRs 38783, 36396)

Display pod node selectors with kubectl describe.

**What this PR does / why we need it**:
This PR fixes kubectl describe so that it now shows associated node selectors with pods.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

@kubernetes/rh-cluster-infra @kubernetes/kubectl
2016-12-14 17:54:52 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Chao Xu 6709b7ada2 run hack/update-codegen.sh
run hack/verify-gofmt.sh
update bazel
2016-12-14 12:39:49 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Derek Carr f1af1e965a Fix typo in drain command 2016-12-14 13:00:25 -05:00
Michail Kargakis bf78c00a96 kubectl: fix 'create deployment' to set container name correctly 2016-12-14 17:32:33 +01:00
Kubernetes Submit Queue 7b8ecda289 Merge pull request #38743 from caesarxuchao/remove
Automatic merge from submit-queue

Remove accidentally committed files

Accidentally committed in #37534.
2016-12-13 20:44:16 -08:00
Chao Xu 411128f294 remove wrongly committed files 2016-12-13 19:44:51 -08:00
Kubernetes Submit Queue 085f0d74dc Merge pull request #38538 from juanvallejo/jvallejo/dont-report-success-if-obj-not-patched
Automatic merge from submit-queue

Prevent "patched" output on obj not patched

**Release note**:
```release-note
release-note-none
```

This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.

@fabianofranz @kubernetes/cli-review
2016-12-13 10:42:26 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
juanvallejo cbe479039b Add json,yaml output format support kubectl create
This patch adds the ability to specify an output format other than
"name" to `kubectl create ...`. It can be used in conjunction with the
`--dry-run` option. Converts unstructured objects into known types in
order to support all `--output` values.
2016-12-12 16:09:12 -05:00
Kubernetes Submit Queue 0ac73a823a Merge pull request #34966 from ivan4th/make-top-pod-test-table-driven
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Make kubectl top pod test table-driven
2016-12-12 11:41:10 -08:00
Kubernetes Submit Queue 3d29c3d229 Merge pull request #36672 from ymqytw/check_annotation_for_apply
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Warn user if they try to apply on an object without the annotation

Give user a warning when using `kubectl apply` on a resource lacking the `LastAppliedConfig` annotation

fixes #36620

Ref: #35134 and #36509.

**Release note**:
```release-note
Issue a warning when using `kubectl apply` on a resource lacking the `LastAppliedConfig` annotation
```
2016-12-12 11:41:06 -08:00
Ivan Shvedunov 9b9c1e6952 Make top pod test table-driven 2016-12-12 20:23:17 +03:00
Clayton Coleman 42e0eda3e4
Sorting printer changed 2016-12-10 18:07:33 -05:00
Clayton Coleman c52d510a24
refactor: generated 2016-12-10 18:05:53 -05:00
Clayton Coleman 42d410fdde
Switch to use pkg/apis/meta/v1/unstructured and the new interfaces
Avoid directly accessing an unstructured type if it is not required.
2016-12-10 18:05:28 -05:00
Kubernetes Submit Queue e732ee70f4 Merge pull request #38406 from liggitt/remove-internal-json-annotations
Automatic merge from submit-queue

Remove json serialization annotations from internal types

fixes #3933

Internal types should never be serialized, and including json serialization tags on them makes it possible to accidentally do that without realizing it.

fixes in this PR:

* types
  * [x] remove json tags from internal types
  * [x] fix references from serialized types to internal ObjectMeta
* generation
  * [x] remove generated json codecs for internal types (they should never be used)
* kubectl
  * [x] fix `apply` to operate on versioned object
  * [x] fix sorting by field to operate on versioned object
  * [x] fix `--record` to build annotation patch using versioned object
* hpa
  * [x] fix unmarshaling to internal CustomMetricTargetList in validation
* thirdpartyresources
  * [x] fix encoding API responses using internal ObjectMeta
* tests
  * [x] fix tests to use versioned objects when checking encoded content
  * [x] fix tests passing internal objects to generic printers

follow ups (will open tracking issues or additional PRs):
- [ ] remove json tags from internal kubeconfig types (`kubectl config set` pathfinding needs to work against external type)
- [ ] HPA should version CustomMetricTargetList serialization in annotations
- [ ] revisit how TPR resthandlers encoding objects
- [ ] audit and add tests for printer use (human-readable printer requires internal versions, generic printers require external versions)
- [ ] add static analysis tests preventing new internal types from adding tags
- [ ] add static analysis tests requiring json tags on external types (and enforcing lower-case first letter)
- [ ] add more tests for `kubectl get` exercising known and unknown types with all output options
2016-12-10 14:00:17 -08:00
ymqytw b6cfa9aa98 warn user if they try to apply on an object without the annotation 2016-12-09 17:29:31 -08:00
juanvallejo 7410acf4ab
Prevent "patched" output on obj not patched
This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.
2016-12-09 19:01:27 -05:00
Kubernetes Submit Queue 68b17c2942 Merge pull request #37270 from xilabao/remove-duplicate-get-errs
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

Remove duplicate get errs

old:
```shell
$ kubectl get ns
NAME          STATUS    AGE
default       Active    2m
kube-system   Active    2m

$ kubectl get ns --all-namespaces
NAMESPACE   NAME      STATUS    AGE
error: namespace is not namespaced
error: namespace is not namespaced
```
new:
```shell
$ kubectl get ns --all-namespaces
NAMESPACE   NAME      STATUS    AGE
error: namespace is not namespaced
```
2016-12-09 14:11:14 -08:00
Jordan Liggitt 4536388909
Update bazel 2016-12-09 16:26:06 -05:00
Jordan Liggitt 2d868441d8
Make sorting work on versioned objects 2016-12-09 16:26:06 -05:00
Jordan Liggitt 8b34e0ed53
Make --record compute patch using versioned object 2016-12-09 16:26:05 -05:00
Jordan Liggitt 12806be2bf
Fix tests using internal types for generic printing 2016-12-09 16:26:05 -05:00
Jordan Liggitt cc7a44f545
Fix tests using internal types for serialization 2016-12-09 16:26:05 -05:00
Jordan Liggitt 3654d63766
Compute apply patch using versioned object 2016-12-09 16:26:04 -05:00
Jordan Liggitt fcf5bbccd6
Fix references from serializable types to use v1.ObjectMeta 2016-12-09 16:26:04 -05:00
Kubernetes Submit Queue b9536688d3 Merge pull request #38429 from duglin/removeDelete
Automatic merge from submit-queue (batch tested with PRs 37860, 38429, 38451, 36050, 38463)

Remove "pod xxx deleted" message from kubectl run --rm

This is a follow-on to https://github.com/kubernetes/kubernetes/issues/28695

Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>

```release-note
kubectl run --rm no longer prints "pod xxx deleted"
```
2016-12-09 13:22:14 -08:00
Kubernetes Submit Queue 7168fce59a Merge pull request #38265 from brendandburns/configmap
Automatic merge from submit-queue (batch tested with PRs 38284, 38403, 38265)

Display config map data, not byte count.

Begins to address https://github.com/kubernetes/kubernetes/issues/36222

Next step is:
`kubectl edit configmap <name> --key=<file-name>`

@kubernetes/sig-cli
2016-12-09 08:50:23 -08:00
Kubernetes Submit Queue 35d6d902e8 Merge pull request #38403 from deads2k/fix-local-up-dns
Automatic merge from submit-queue (batch tested with PRs 38284, 38403, 38265)

Fix local up cluster dns with RBAC

The DNS server needs permissions to run using RBAC.  This does it with a big hammer before we sort out tight permissions.

@fabianofranz for the CLI change
@xilabao for the local-up-cluster change
2016-12-09 08:50:21 -08:00
Kubernetes Submit Queue aae1b14592 Merge pull request #33083 from mfojtik/resolve-image
Automatic merge from submit-queue

Add ResolveImage function to CLI factory

This functions helps to integrate third-party mechanism for resolving the image names. For example, this function can be used in OpenShift to add support for resolving the ImageStreamTag and ImageStreamImage.

See: https://github.com/openshift/origin/pull/10995
2016-12-09 05:26:52 -08:00
Michal Fojtik 737b32772e add ResolveImage function to CLI factory 2016-12-09 12:41:38 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Kubernetes Submit Queue 5628cde1bd Merge pull request #37164 from duglin/removeWaiting
Automatic merge from submit-queue (batch tested with PRs 38413, 37164)

Remove chatty "waiting for pod" msg from kubectl run

Attacking #28695 one step at a time

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 18:08:55 -08:00
Doug Davis 24fbba393e Remove "pod xxx deleted" message from kubectl run --rm
Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 17:40:08 -08:00
Kubernetes Submit Queue b0b6f3c256 Merge pull request #38401 from liggitt/addressable-deep-copy
Automatic merge from submit-queue (batch tested with PRs 36071, 32752, 37998, 38350, 38401)

Pass addressable values to DeepCopy

Extracted from https://github.com/kubernetes/kubernetes/pull/35728

These are the places we are currently calling DeepCopy incorrectly, and we need to fix, even if we don't pick up the changes to DeepCopy in #35728:
* creating a new cloner means we have no generated functions registered
* passing non-addressable values doesn't pick up generated deep copy functions, and forces us into reflective mode
2016-12-08 16:26:00 -08:00
Kubernetes Submit Queue e3b9546028 Merge pull request #32752 from fraenkel/logs_selector
Automatic merge from submit-queue (batch tested with PRs 36071, 32752, 37998, 38350, 38401)

Allow a selector when retrieving logs

#19873

initial commit to see if I am headed in the right direction.
Its missing all the test cases, but the selector path works.
2016-12-08 16:25:54 -08:00
Kubernetes Submit Queue 76e0b1af54 Merge pull request #36071 from juanvallejo/jvallejo/fix-set-image-local-output
Automatic merge from submit-queue

fix local resource output when `-f` not specified

**Release note**:
```release-note
release-note-none
```

`kubectl set image` does not have a `--dry-run` option. Although it offers a
`--local` flag, it does not support server request, limiting input to that of stdin
or that of a local file.

This patch adds a `--dry-run` option to the `kubectl set image` command,
allowing for resources from the server to be selected, without making any
mutations.

cc @ncdc 

Related PR: https://github.com/kubernetes/kubernetes/pull/36174
2016-12-08 16:20:00 -08:00
juanvallejo 6eaab223f2 add --dry-run opt to `kubectl set image`
This patch adds a `--dry-run` option to `kubectl set image...`
2016-12-08 15:50:52 -05:00
deads2k b18e433590 add serviceaccount option to clusterrrolebinding 2016-12-08 14:18:39 -05:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Kubernetes Submit Queue b650149ee1 Merge pull request #37096 from andor-pierdelacabeza/patch-1
Automatic merge from submit-queue (batch tested with PRs 38260, 32811, 28458, 33570, 37096)

Fix renaming order shown on terminal
2016-12-08 02:11:26 -08:00
Kubernetes Submit Queue fa5556b92b Merge pull request #32811 from fraenkel/headless_service
Automatic merge from submit-queue (batch tested with PRs 38260, 32811, 28458, 33570, 37096)

Allow no ports when exposing headless service

fixes #32795
2016-12-08 02:11:20 -08:00
Kubernetes Submit Queue f8dd91fb28 Merge pull request #36541 from juanvallejo/jvallejo/remove-duplicate-describer-errs
Automatic merge from submit-queue (batch tested with PRs 36626, 37294, 37463, 37943, 36541)

Remove duplicate describer errs

Downstream issue https://github.com/openshift/origin/issues/11846

**Release note**:
```release-note
release-note-none
```

The `describe` command iterates through a list of infos received from
the server and aggregates a list of errors while attempting to call each
resource's respective describer. When a resource exists, but does not
have a describer set, such as `Event`, the `describe` command outputs
the same error `error: no description has been implemented for "Event"`
for each info.

```
$ kubectl describe events
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
```

@kubernetes/kubectl @fabianofranz
2016-12-08 00:23:16 -08:00
Kubernetes Submit Queue c323c72a66 Merge pull request #37943 from ailusazh/ailusa
Automatic merge from submit-queue (batch tested with PRs 36626, 37294, 37463, 37943, 36541)

Add Version to the resource printer for 'get nodes'

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-08 00:23:15 -08:00
Kubernetes Submit Queue 910912ea3b Merge pull request #37364 from foxyriver/status-code
Automatic merge from submit-queue

use status code const to express http status

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Using status code const to express http status.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 22:47:46 -08:00
Avesh Agarwal 588ad30d10 Display pod node selectors with kubectl describe. 2016-12-08 01:28:40 -05:00
xilabao 0dc166a9fa Remove duplicate get errs 2016-12-08 13:56:56 +08:00
deads2k b658552947 remove validation dependency on version negotiation 2016-12-07 13:23:20 -05:00
Kubernetes Submit Queue ce93c81029 Merge pull request #38092 from xilabao/fix-alias-conflict
Automatic merge from submit-queue (batch tested with PRs 35101, 38215, 38092)

fix alias conflict of clusterrolebinding

create_configmap alias is "cm"
2016-12-07 07:27:17 -08:00
Kubernetes Submit Queue 490151ee50 Merge pull request #38181 from tanshanshan/remove-todo
Automatic merge from submit-queue (batch tested with PRs 38181, 38128, 36711)

Remove redundant conditional statement

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

1. remove redundant conditional statement
2. replace  errors.New(fmt.Sprintf with fmt.Errorf 

Thanks.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 03:09:30 -08:00
Kubernetes Submit Queue 36d593c749 Merge pull request #38085 from yarntime/fix_typo_in_scale
Automatic merge from submit-queue (batch tested with PRs 37693, 38085)

fix typo in scale

fix typo.
2016-12-07 00:52:29 -08:00
Brendan Burns 670b21e11c Display config map data, not byte count. 2016-12-06 22:36:40 -08:00
tanshanshan c76cd49da1 remove redundant condition 2016-12-07 08:39:40 +08:00
Mike Danese e225625a80 add a configuration for kubelet to register as a node with taints
and deprecate register-schedulable
2016-12-06 10:32:54 -08:00
Kubernetes Submit Queue e4abc36d5d Merge pull request #37636 from juanvallejo/jvallejo/bugfix/print-resource-kind-when-single-resource-type
Automatic merge from submit-queue

add resource prefix to multiple items w/ same kind

**Release note**:
```release-note
release-note-none
```

This patch ensures that a resource prefix is added to multiple items of
the same kind, when using `kubectl get all`. Before, a prefix was added only
when a single item was returned on `kubectl get all`, but ignored if only a
single resource kind existed but multiple items for that kind were
returned.

**Example**
```
$ kubectl get all
No resources found.

$ kubectl create service loadbalancer testsvc1 --tcp=8080
$ kubectl get all
NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h

$ kubectl create service loadbalancer testsvc2 --tcp=8081
$ kubectl get all
NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h
svc/testsvc2       172.30.241.197   172.46.164.158,172.46.164.158   8081/TCP   1h
```

@fabianofranz
2016-12-06 07:43:07 -08:00
Kubernetes Submit Queue 653fd97ba0 Merge pull request #37966 from p0lyn0mial/unify_restmapping_and_restmappings
Automatic merge from submit-queue (batch tested with PRs 38185, 37966)

decided to extract common logic for RESTMapping and RESTMappings to a…

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: the changes introduced in this PR extract common logic of RESTMapping and RESTMappings to one common method. 

**Special notes for your reviewer**: this is my first PR - be polite.



The only change in logic to what was before is when calling commonRESTMappings from RESTMapping
we search all defaultGroupVersion as opposed to just one when no mapping was found for provided versions.
2016-12-06 06:49:25 -08:00
tianshapjq 55521ee8be remove the create-external-load-balancer flag in cmd/expose.go 2016-12-06 16:48:32 +08:00