Commit Graph

3139 Commits (6d9e2afedab933641833e9614bde362416072183)

Author SHA1 Message Date
tianshapjq 8057170588 gofmt the service_test.go 2017-02-03 08:55:41 +08:00
ymqytw ad7ffd79c3 apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK 2017-02-02 15:19:50 -08:00
Kubernetes Submit Queue 9721459536 Merge pull request #39279 from andrewsykim/kubectl-get-hpa-show-current-replicas
Automatic merge from submit-queue (batch tested with PRs 35782, 35831, 39279, 40853, 40867)

kubectl get hpa should print number of replicas

**What this PR does / why we need it**:
Prints number of replicas on deployment managed by HPA. 

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
None, couldn't find one related.

**Special notes for your reviewer**:
Couldn't find any tests for validating kubectl output for hpa, if there are please point me to them and I will add. 

**Release note**:

```release-note
```
2017-02-02 09:53:50 -08:00
Piotr Szczesniak a35ad8f6ba Removed HPA objects from extensions api group 2017-02-02 14:09:54 +01:00
Kubernetes Submit Queue 9807cd7d06 Merge pull request #40630 from liggitt/apply-null
Automatic merge from submit-queue (batch tested with PRs 40529, 40630)

propagate explicit nulls in apply

Rebase of https://github.com/kubernetes/kubernetes/pull/35496 on top of https://github.com/kubernetes/kubernetes/pull/40260

The client-side propagation of the raw value is no longer needed, since the client is preserving the original object in unstructured form (explicit nulls are preserved).

Kept tests and CreateThreeWayMergePatch changes from https://github.com/kubernetes/kubernetes/pull/35496

```release-note
kubectl apply now supports explicitly clearing values not present in the config by setting them to null
```

- [x] Clean up orphaned objects in test-cmd to preserve pre- and post- conditions
- [x] improve CreateThreeWayMergePatch test to not filter based on string comparison to test name
2017-02-01 00:16:39 -08:00
Kubernetes Submit Queue 61d45f5900 Merge pull request #40541 from fabianofranz/fix_sorting_printer_with_missing_fields
Automatic merge from submit-queue (batch tested with PRs 40645, 40541, 40769)

Fix sorting printer when sorting by a missing field

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

When calling `kubectl get` with the `--sort-by` flag, the command will error out if the field used for sorting is not present in at least one of the objects returned in the list, *even if it is a field valid in the object's model*. 

For example, taking a list of `ReplicationController` where one of them has `status: { replicas: 0 }` (so nothing in `status.availableReplicas`, even that being a valid object in the model and present in every other object of the list) :

```
$ oc get rc --sort-by=status.availableReplicas
error: availableReplicas is not found
```

This PR now traverses the entire list of objects to be sorted and, if at least one has the field provided in `--sort-by`, we sort correctly and consider the field empty in every other object where the field is not present. If none of the objects has the field, we error out (that will catch really invalid fields, and valid ones but not present in any object in the list, which is acceptable). No swagger validation here.

**Release note**:
```release-note
Fixed an issue where 'kubectl get --sort-by=' would return an error when the specified field were not present in at least one of the returned objects, even that being a valid field in the object model.
```
2017-01-31 22:00:38 -08:00
Kubernetes Submit Queue dcf26ed855 Merge pull request #40718 from janetkuo/secret-volume-describe-fix
Automatic merge from submit-queue (batch tested with PRs 40638, 40742, 40710, 40718, 40763)

Fix formatting issue of secret volume describer

Fixing a `kubectl describe` bug

**Before**:

```yaml
...
Volumes:
  default-token-z7g96:
    Type:       Secret (a volume populated by a Secret)
    SecretName:     Optional:   %v

%!(EXTRA string=default-token-z7g96, bool=false)QoS Class:      BestEffort
...
```

**After**:

```yaml
...
Volumes:
  default-token-z7g96:
    Type:       Secret (a volume populated by a Secret)
    SecretName: default-token-z7g96
    Optional:   false
QoS Class:      BestEffort
...
```
2017-01-31 20:40:46 -08:00
Kubernetes Submit Queue 76550cf2de Merge pull request #40710 from deads2k/client-21-record
Automatic merge from submit-queue (batch tested with PRs 40638, 40742, 40710, 40718, 40763)

move client/record

An attempt at moving client/record to client-go.  It's proving very stubborn and needs a lot manual intervention and near as I can tell, no one actually gets any benefit from the sink and source complexity it adds.

@sttts @caesarchaoxu
2017-01-31 20:40:45 -08:00
Kubernetes Submit Queue c09311fa32 Merge pull request #40111 from juanvallejo/jvallejo/add-ensure-print-headers
Automatic merge from submit-queue

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.

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

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

cc @fabianofranz @AdoHe
2017-01-31 18:53:27 -08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
Jordan Liggitt cf74abd892
fixup apply null tests 2017-01-31 15:00:23 -05:00
Anastasis Andronidis 4bdcc03c0b
test for explicit null value propagation in apply 2017-01-31 14:22:24 -05:00
deads2k 700c30f3c7 move portforward to client-go 2017-01-31 14:13:35 -05:00
Kevin 36dcb57407 forgiveness library changes 2017-01-31 21:39:17 +08:00
Kubernetes Submit Queue 25de8ef641 Merge pull request #40551 from juanvallejo/jvallejo/only-output-no-resources-found-for-human-readable-printer
Automatic merge from submit-queue (batch tested with PRs 40691, 40551, 40683, 40700, 40702)

only output "No resources found." for human readable printers

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

This patch removes the message `No resources found` (currently printed through stderr) when printing through a generic / non-human-readable printer (json, yaml, jsonpath, custom-columns).

**Before***
```
$ kubectl get pods -o json
No resources found.
{
    "apiVersion": "v1",
    "items": [],
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
}
```

**After**
```
$ kubectl get pods -o json
{
    "apiVersion": "v1",
    "items": [],
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
}
```

cc @fabianofranz @stevekuznetsov
2017-01-30 19:14:41 -08:00
Janet Kuo d76683be22 Fix formatting issue of secret volume describer 2017-01-30 18:40:12 -08:00
Kubernetes Submit Queue 9574ef54ec Merge pull request #40618 from janetkuo/patch-resource-name
Automatic merge from submit-queue (batch tested with PRs 40703, 40093, 40618, 40659, 39810)

Print resource name when patch is done

Before:
```console
$ kubectl patch deployment nginx -p '{"spec":{"progressDeadlineSeconds":200}}'
"nginx" patched
```

After:
```console
$ kubectl patch deployment nginx -p '{"spec":{"progressDeadlineSeconds":200}}'
deployment "nginx" patched
```
2017-01-30 17:14:54 -08:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Kubernetes Submit Queue 2cb17cc677 Merge pull request #40426 from sttts/sttts-more-cutoffs-3
Automatic merge from submit-queue

genericapiserver: cut off more dependencies – episode 3

Compare commit subjects.

This is the first step to get `apiserver_test.go` and `watch_test.go` in `pkg/genericapiserver/endpoints` cutoff from k8s.io/kubernetes dependencies.

After this we have to sync client-go and then "episode 4" can go in.

approved based on #40363
2017-01-30 05:57:49 -08:00
Brendan Burns eecfcfb376 Extract strings for the 'kubectl set' family of commands. 2017-01-29 14:46:07 -08:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski 79adb99a13 pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Fabiano Franz 5eeef81edf Fix sorting printer with missing fields 2017-01-28 19:56:53 -02:00
Brendan Burns 25ba561702 Extract strings for translation for the kubectl config family. 2017-01-27 20:31:49 -08:00
Janet Kuo a155111acd Print resource name when patch is done 2017-01-27 14:58:52 -08:00
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