Commit Graph

3670 Commits (cf80b91a9e4dfb6d3f366ae6b2e70e9e3961c52f)

Author SHA1 Message Date
Jordan Liggitt e8b24679dc
Remove redirect verb parsing 2017-06-21 11:17:24 -04:00
FengyunPan f01f9a9035 Output TYPE for getting service
Now service already supported 4 ServiceTypes, ServiceTypes is
friendly to distinguish services, so outputing service type better
when running 'kubectl get service'.
2017-06-18 12:19:57 +08:00
Kubernetes Submit Queue 48d263d3bf Merge pull request #44282 from derekwaynecarr/fix-kubectl-logs
Automatic merge from submit-queue (batch tested with PRs 38751, 44282, 46382, 47603, 47606)

kubectl logs with label selector supports specifying a container name

**What this PR does / why we need it**:
Allows `kubectl logs` to take both a label selector and container name.  This allows me to fetch logs from pods by selector whose pods have multiple containers with a common name.  This is a common action when debugging components like the service-catalog that ship more than one container in their pod.  With this change, the following command lets me get logs for service-catalog.

```
$ kubectl logs -l app=sc-catalog-apiserver --namespace=service-catalog --container=apiserver
```
2017-06-16 18:05:48 -07:00
Jun Xiang Tee d76b08d154 deprecate created-by annotation for pod drain 2017-06-16 13:33:26 -07:00
Kubernetes Submit Queue c31893978b Merge pull request #45918 from juanvallejo/jvallejo/fix-kubectl-set-resources-local
Automatic merge from submit-queue

fix --local flag for kubectl commands

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

**Release note**:
```release-note
NONE
```

Fixes the `--local` flag for `kubectl set ...` sub-commands.
**As of the 1.7 release**, `PrinterForCommand` was updated to [use a mapper and typer for unstructured objects](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/factory_builder.go#L52), which further prevented the use of `--local` when there was no connection to an api server.


**before** (with no connection to a server)
```
$ kubectl set resources -f pod.json --limits=cpu=200m,memory=512Mi --local
error: unable to connect to a server to handle "pods": Get https://10.13.137.149:8443/api: dial tcp 10.13.137.149:8443: getsockopt: connection refused
```

**after** (with no connection to a server)
```
$ kubectl set resources -f pod.json --limits=cpu=200m,memory=512Mi --local
NAME              READY     STATUS    RESTARTS   AGE
mypod   0/1                 0          <unknown>
```

cc @smarterclayton @fabianofranz
2017-06-16 08:19:13 -07:00
Lee Verberne 01c7d129fb Create a kubectl alpha subcommand
Alpha commands can be added under `kubectl alpha` and are always
accessible (regardless of feature gates). If no alpha commands have been
defined then `alpha` is not displayed in `help`.
2017-06-16 07:09:21 +00:00
Haoran Wang f732e4baae Clean up Deployment overlap annotation code 2017-06-16 14:20:44 +08:00
Kubernetes Submit Queue a36d9df224 Merge pull request #47450 from kargakis/fix-drain
Automatic merge from submit-queue (batch tested with PRs 47523, 47438, 47550, 47450, 47612)

Ignore 404s on evict

One of our upgrades failed with 
```
error: error when evicting pod \"boo-2-deploy\": pods \"boo-2-deploy\" not found"
```

@derekwaynecarr since you already fixed half of it 

cc: @kubernetes/sig-cli-bugs 

I failed terribly at adding a unit test mostly because draining involves discovery for the eviction API and the fake client stuff for discovery are far from functional - will spawn a separate issue about it.

fyi @jupierce

related: https://github.com/kubernetes/kubectl/issues/28
2017-06-15 18:54:06 -07:00
Kubernetes Submit Queue ef20034a04 Merge pull request #47204 from janetkuo/kubectl-apply-change-cause
Automatic merge from submit-queue (batch tested with PRs 47204, 46808, 47432, 47400, 47099)

Make kubectl apply add change-cause before patching

**What this PR does / why we need it**: We shouldn't patch the project with applied change, and then patch again with the change cause. Otherwise, DaemonSet change cause wouldn't be copied to its history (after the first patch, history will be created with the old change cause). 

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

**Special notes for your reviewer**: 
/assign @mengqiy 
@kubernetes/sig-apps-bugs @kubernetes/sig-cli-maintainers 

**Release note**:

```release-note
NONE
```
2017-06-14 17:13:54 -07:00
Kubernetes Submit Queue d067836030 Merge pull request #46852 from tnozicka/lookup-no-headers-safely
Automatic merge from submit-queue (batch tested with PRs 47470, 47260, 47411, 46852, 46135)

Lookup --no-headers flag safely in PrinterForCommand function

If this was invoked by a command that did not call AddPrinterFlags first, it ended up with fatal error on `GetFlagBool(cmd, "no-headers")`. This is causing a bug in OpenShift's command reusing this code and not actually having a flag `--no-headers`.
2017-06-14 12:52:24 -07:00
ymqytw b99e57149d fix env flag 2017-06-13 14:53:09 -07:00
Kubernetes Submit Queue 7560142e27 Merge pull request #47276 from kow3ns/rm-partition-strategy
Automatic merge from submit-queue (batch tested with PRs 46441, 43987, 46921, 46823, 47276)

Remove PartitionStatefulSetStrategyType

This PR removes PartitionStatefulSetStrategyType add adds a parameter to RollingUpdateStatefulSetStrategyType as described in the issue below. We need this PR to ensure that the StatefulSet API conforms to the existing API for DaemonSet.

fixes #46975
```release-note
NONE
```
@kargakis 
@smarterclayton 
@janetkuo
2017-06-13 13:55:53 -07:00
Michail Kargakis 26d3eadb46
Ignore 404s on evict 2017-06-13 20:21:26 +02:00
juanvallejo d036686185
fix --local flag for `kubectl set` commands 2017-06-13 12:57:05 -04:00
Janet Kuo 03af5233bd Make kubectl apply add change-cause before patching 2017-06-12 23:49:42 -07:00
Kubernetes Submit Queue aa35738a21 Merge pull request #47075 from janetkuo/ds-history-patch
Automatic merge from submit-queue

Change what is stored in DaemonSet history `.data`

**What this PR does / why we need it**: 
In DaemonSet history `.data`, store a strategic merge patch that can be applied to restore a DaemonSet. Only PodSpecTemplate is saved. 

This will become consistent with the data stored in StatefulSet history. 

Before this fix, a serialized pod template is stored in `.data`; however, seriazlized pod template isn't a `runtime.RawExtension`, and caused problems when controllers try to patch the history's controller ref. 

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

**Special notes for your reviewer**: @kubernetes/sig-apps-bugs @erictune @kow3ns @kargakis @lukaszo @mengqiy 

**Release note**:

```release-note
NONE
```
2017-06-12 23:31:08 -07:00
Kenneth Owens 22957a6bb1 Update StatefulSet rollout status for parameterized RollingUpdate 2017-06-12 10:07:07 -07:00
Tomas Nozicka eb139f4572 Lookup --no-headers flag safely in PrinterForCommand function 2017-06-12 17:30:26 +02:00
Kazuki Suda 11230907b3 Fix missing __kubectl_parse_config 2017-06-11 07:12:23 +09:00
Janet Kuo 2b8f91e549 Update kubectl rollout to consume `.data` of DaemonSet history
Also update tset data to make sure DaemonSet template is replaced, not
merged, when rolling back.
2017-06-10 10:52:33 -07:00
Derek Carr 1dc4d77942 kubectl drain errors if pod is already deleted 2017-06-09 17:05:43 -04:00
Cao Shufeng a70ec5ba40 [trivial]fix function name in comment 2017-06-09 11:26:06 +08:00
Haoran Wang 896288a1cb StatefulSetHasDesiredReplicas condition should check ObservedGeneration and update statefulset reaper use StatefulSetHasDesiredReplicas 2017-06-09 10:15:34 +08:00
Kubernetes Submit Queue 49866b864c Merge pull request #47013 from smarterclayton/fix_printer
Automatic merge from submit-queue (batch tested with PRs 47024, 47050, 47086, 47081, 47013)

Wrap HumanReadablePrinter in tab output unless explicitly asked not to

`kubectl get` was not properly aligning its output due to #40848 

Fixes an accidental regression. In general, we should not accept an incoming tabwriter and instead manage at a higher level. Fix the bug and add a comment re: future refactoring.
2017-06-07 16:53:47 -07:00
Kubernetes Submit Queue 0613ae5077 Merge pull request #46669 from kow3ns/statefulset-update
Automatic merge from submit-queue (batch tested with PRs 46235, 44786, 46833, 46756, 46669)

implements StatefulSet update

**What this PR does / why we need it**:
1. Implements rolling update for StatefulSets
2. Implements controller history for StatefulSets.
3. Makes StatefulSet status reporting consistent with DaemonSet and ReplicaSet.

https://github.com/kubernetes/features/issues/188

**Special notes for your reviewer**:

**Release note**:
```release-note
Implements rolling update for StatefulSets. Updates can be performed using the RollingUpdate, Paritioned, or OnDelete strategies. OnDelete implements the manual behavior from 1.6. status now tracks 
replicas, readyReplicas, currentReplicas, and updatedReplicas. The semantics of replicas is now consistent with DaemonSet and ReplicaSet, and readyReplicas has the semantics that replicas did prior to this release.
```
2017-06-07 00:27:53 -07:00
Kenneth Owens 1a784ef86f Auto generated code for StatefulSet update 2017-06-06 13:47:19 -07:00
Sunil Arora f768a63fb0 Get cmd uses print-column extn from Openapi schema
Get command now uses metadata x-kubernetes-print-columns, if present, in Openapi schema
to format output for a resource. This functionality is guarded by a boolean
flag 'use-openapi-print-columns'.
2017-06-06 13:30:24 -07:00
Kenneth Owens cec4171775 Implements kubectl rollout status and history for StatefulSet 2017-06-06 12:00:28 -07:00
Kubernetes Submit Queue 60e038054b Merge pull request #46727 from janetkuo/kubectl-valid-resources
Automatic merge from submit-queue (batch tested with PRs 46112, 46764, 46727, 46974, 46968)

Add controllerrevisions as valid resource in kubectl help

**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**: controllerrevisions is a new resource added in 1.7 @kubernetes/sig-cli-maintainers 

**Release note**:

```release-note
```
2017-06-06 03:17:43 -07:00
Clayton Coleman b1abedbc64
Wrap HumanReadablePrinter in tab output unless explicitly asked not to
Fixes an accidental regression. In general, we should not accept an
incoming tabwriter and instead manage at a higher level. Fix the bug and
add a comment re: future refactoring.
2017-06-05 22:06:38 -04:00
Kubernetes Submit Queue bdf9dc1620 Merge pull request #46144 from janetkuo/kubectl-rollout-ds
Automatic merge from submit-queue (batch tested with PRs 45871, 46498, 46729, 46144, 46804)

Implement kubectl rollout undo and history for DaemonSet

~Depends on #45924, only the 2nd commit needs review~ (merged)

Ref https://github.com/kubernetes/community/pull/527/

TODOs:
- [x] kubectl rollout history
  - [x] sort controller history, print overview (with revision number and change cause)
  - [x] print detail view (content of a history) 
    - [x] print template 
    - [x] ~(do we need to?) print labels and annotations~
- [x] kubectl rollout undo: 
  - [x] list controller history, figure out which revision to rollback to
    - if toRevision == 0, rollback to the latest revision, otherwise choose the history with matching revision
  - [x] update the ds using the history to rollback to 
    - [x] replace the ds template with history's
    - [x] ~(do we need to?) replace the ds labels and annotations with history's~
- [x] test-cmd.sh 

@kubernetes/sig-apps-pr-reviews @erictune @kow3ns @lukaszo @kargakis @kubernetes/sig-cli-maintainers 

--- 

**Release note**:

```release-note
```
2017-06-05 03:06:26 -07:00
xilabao 8fe8e4f106 fix parse pairs 2017-06-05 11:06:48 +08:00
Kubernetes Submit Queue 8929a73a6f Merge pull request #46758 from zhangxiaoyu-zidif/delete-unused-code
Automatic merge from submit-queue

Delete meaningless check

**What this PR does / why we need it**:
Delete meaningless check
The deleted check is redundant.

**Release note**:

```release-note
NONE
```
2017-06-03 22:11:01 -07:00
Kubernetes Submit Queue 64a4d23af2 Merge pull request #46706 from CaoShuFeng/unit-create-role
Automatic merge from submit-queue (batch tested with PRs 40760, 46706, 46783, 46742, 46751)

Fix unit test for kubectl create role

When expected err is not nil but error deos not happen, we should report error in unit test.
**Release note**:

```
NONE
```
2017-06-03 18:30:40 -07:00
Janet Kuo edabdac094 Implement kubectl rollout history and undo for DaemonSet 2017-06-03 17:10:57 -07:00
Kubernetes Submit Queue e837c3bbc2 Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

Dynamic webhook admission control plugin

Unit tests pass.

Needs plumbing:
* [ ] service resolver (depends on @wfender PR)
* [x] client cert (depends on ????)
* [ ] hook source (depends on @caesarxuchao PR)

Also at least one thing will need to be renamed after Chao's PR merges.

```release-note
Allow remote admission controllers to be dynamically added and removed by administrators.  External admission controllers make an HTTP POST containing details of the requested action which the service can approve or reject.
```
2017-06-02 23:37:42 -07:00
zhangxiaoyu-zidif ac1c513c82 Add test case for namespace 2017-06-03 14:35:49 +08:00
Kubernetes Submit Queue 2629bf79f2 Merge pull request #46265 from waseem/printers-genericity
Automatic merge from submit-queue (batch tested with PRs 41563, 45251, 46265, 46462, 46721)

Denote if a printer is generic.

This fixes #38779.

This allows us to avoid case in which printers.GetStandardPrinter
returns nil for both printer and err removing any potential panics that
may arise throughout kubectl commands.

Please see #38779 and #38112 for complete context.
2017-06-02 19:53:40 -07:00
Kubernetes Submit Queue 97a5d37841 Merge pull request #40848 from smarterclayton/serverside_get
Automatic merge from submit-queue (batch tested with PRs 46432, 46701, 46326, 40848, 46396)

Add a server side Get operation

Implement proposal kubernetes/community#363

```release-note
The Kubernetes API supports retrieving tabular output for API resources via a new mime-type `application/json;as=Table;v=v1alpha1;g=meta.k8s.io`.  The returned object (if the server supports it) will be of type `meta.k8s.io/v1alpha1` with `Table`, and contain column and row information related to the resource.  Each row will contain information about the resource - by default it will be the object metadata, but callers can add the `?includeObject=Object` query parameter and receive the full object.  In the future kubectl will use this to retrieve the results of `kubectl get`.
```
2017-06-02 11:47:11 -07:00
Kubernetes Submit Queue b7a424fd06 Merge pull request #46701 from CaoShuFeng/unit_clusterrole_binding
Automatic merge from submit-queue (batch tested with PRs 46432, 46701, 46326, 40848, 46396)

add some unit tests for "kubectl create clusterrole"

#45809 adds support for non-resource-url to "kubectl create clusterrole"
This pr add some unit test for #45809 

**Release note**:

```
NONE
```
2017-06-02 11:47:04 -07:00
Kubernetes Submit Queue 54cf289467 Merge pull request #46432 from CaoShuFeng/can-i-non-resource-url
Automatic merge from submit-queue (batch tested with PRs 46432, 46701, 46326, 40848, 46396)

This change add nonResourceURL to kubectl auth cani

**Release note**:

```
support nonResourceURL to kubectl auth cani
```
2017-06-02 11:47:01 -07:00
zhangxiaoyu-zidif 02af4b31a6 Use t.Fatalf instead 2017-06-02 17:35:33 +08:00
zhangxiaoyu-zidif 4ee0a74049 fix comment of isDir 2017-06-02 09:26:13 +08:00
nikhiljindal 340e8b1852 Deleting ServiceReaper 2017-06-01 14:25:01 -07:00
Kubernetes Submit Queue 82245a1f06 Merge pull request #45980 from mengqiy/setElementOrder
Automatic merge from submit-queue

support setElementOrder

Implement [proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/preserve-order-in-strategic-merge-patch.md).

Fixes #40373

```release-note
kubectl edit and kubectl apply will keep the ordering of elements in merged lists
```
2017-06-01 09:12:13 -07:00
Kubernetes Submit Queue 2269f5ca76 Merge pull request #43505 from zjj2wry/004
Automatic merge from submit-queue

unit test for kubectl config set-cluster

**What this PR does / why we need it**:
unit test for create cluster

**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**:
i want test secure mode,but CA path how set?

**Release note**:

```release-note
NONE
```
2017-06-01 05:16:02 -07:00
zhangxiaoyu-zidif d519800cf0 Delete meaningless check 2017-06-01 16:17:16 +08:00
xilabao fe4afa8643 allow output patch string in edit command 2017-06-01 14:53:17 +08:00
Daniel Smith d6e1140b5d Implement dynamic admission webhooks
Also fix a bug in rest client
2017-05-31 16:38:46 -07:00
ymqytw c3481b07d2 support setElementOrder 2017-05-31 15:08:25 -07:00
Janet Kuo 97ebcc8382 Add controllerrevisions as valid resource in kubectl help 2017-05-31 13:18:26 -07:00
Cao Shufeng a5865cfa1d Fix unit test for kubectl create role 2017-05-31 19:30:24 +08:00
Cao Shufeng fb8d78bec9 add some unit tests for "kubectl create clusterrole" 2017-05-31 17:43:15 +08:00
zhengjiajin 7a55b5663c Delete unuse err check 2017-05-31 15:45:03 +08:00
Waseem Ahmad 8442a118ea Denote if a printer is generic.
This fixes #38779.

This allows us to avoid case in which printers.GetStandardPrinter
returns nil for both printer and err removing any potential panics that
may arise throughout kubectl commands.

Please see #38779 and #38112 for complete context.

Add comment explaining adding handlers to printers.HumanReadablePrinter
also remove an unnecessary conversion of printers.HumanReadablePrinter
to printers.ResourcePrinter.
2017-05-31 13:02:23 +05:30
Kubernetes Submit Queue 9c7b59778c Merge pull request #46394 from alexandercampbell/write-help-messages-to-stdout
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

Write "kubectl options" help message to stdout, not stderr

Fix a very minor issue causing `kubectl` to write its help messages to `stderr` instead of `stdout`.

Try this:

`kubectl options | grep log`

It should print only the options related to logging, but right now it prints the entire help menu (since it's printing to stderr).

This patch brings us closer to unix convention and reduces user friction.

~~Another use case (if a user can't remember whether it's `-r` or `-R` for recursion):~~

~~`kubectl patch -h | grep recursive`~~

Update: this patch only affects `kubectl options`. The other commands are working as intended.

**Release note**:

```release-note
NONE
```
2017-05-31 00:14:00 -07:00
Kubernetes Submit Queue e97b72296f Merge pull request #46556 from mbohlool/gvk
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Use meta.v1 GroupVersionKind with json tags to generate OpenAPI spec

We are using two different GVK struct in generation of OpenAPI extensions. This PR unify that and also add json tags to meta.v1 GVK to comply with json naming system in other serializations. Also the value of Action extension is now lowercase.

ref: https://github.com/kubernetes/kubernetes/pull/46388
2017-05-30 23:20:04 -07:00
zhengjiajin 7c362f2f65 unit test for create cluster 2017-05-31 14:19:12 +08:00
Cao Shufeng 3bf3a031e8 This change add nonResourceURL to kubectl auth cani 2017-05-31 11:25:29 +08:00
Kubernetes Submit Queue f7215b7cdf Merge pull request #45755 from ahmetb/set-context-differentiate
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Differentiate update/create message on set-context
2017-05-30 14:57:07 -07:00
Kubernetes Submit Queue 001513e9d0 Merge pull request #46100 from zjj2wry/hh
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

clean up: put test description in head to clear

**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**:

```release-note
```
2017-05-30 14:56:59 -07:00
mbohlool a3cbfde4b1 Make OpenAPI GVK and Action extensions all lower-case 2017-05-30 14:43:27 -07:00
Kubernetes Submit Queue 1889d654f5 Merge pull request #46114 from arthur0/rename_context
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

Add `kubectl config rename-context`

Add `kubectl config rename-context`

This command allows renaming a context, instead of editing manually in .kubeconfig

Fix https://github.com/kubernetes/kubernetes/issues/45131

```release-note
Add `kubectl config rename-context`
```
2017-05-30 11:59:07 -07:00
Kubernetes Submit Queue 69c4a8ff0c Merge pull request #46281 from zjj2wry/err
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

add error info

**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**:

```release-note
NONE
```
2017-05-30 11:59:02 -07:00
Kubernetes Submit Queue a07298ce54 Merge pull request #46608 from fabianofranz/fixes_kubectl_cache_on_windows
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Fixes kubectl cached discovery on Windows

Fixes https://github.com/kubernetes/kubectl/issues/18

The `kubectl` cached discovery makes use of `func (f *File) Chmod(mode FileMode) error` which is not supported and errors out on Windows, making `kubectl get` and potentially a number of other commands to fail miserably on that platform. `os.Chmod` by file name, on the other hand, does not error out and should be used instead.

**Release note**:

```release-note
NONE
```
@deads2k @brendandburns @kubernetes/sig-cli-pr-reviews
2017-05-30 08:41:54 -07:00
Kubernetes Submit Queue 4979ae4b86 Merge pull request #46074 from zjj2wry/set-image
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

add test for set image validation

**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**:

```release-note
```
2017-05-30 03:47:02 -07:00
Kubernetes Submit Queue 49b0fe17c9 Merge pull request #45335 from zhangxiaoyu-zidif/fix-goerrors-new
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

fmt.Errorf replaces errors

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

fmt.Errorf replaces errors
importing errors is redundant.

**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**:

```release-note
NONE
```
2017-05-30 03:46:57 -07:00
xiangpengzhao 7092307f5e
Mark deprecated info in short description of deprecated commands. 2017-05-30 15:43:50 +08:00
Clayton Coleman 7ce63eb608
Refactor printers to support rendering as a Table
Return tables from the server.
2017-05-29 18:30:10 -04:00
Fabiano Franz 5c4da128c3 Fixes kubectl cached discovery on Windows 2017-05-29 17:52:00 -03:00
Alexander Campbell 0d65d9594c cmd/options: `kubectl options` writes to `out` stream
Previous behavior was to write to stderr (thanks to the fallback system
in the Cobra library), which made it difficult to grep for flags.

For example:

	kubectl options | grep recursive
2017-05-28 11:23:44 -07:00
zhengjiajin 586ebdb337 add error info 2017-05-27 22:27:12 +08:00
Kubernetes Submit Queue 1720e20059 Merge pull request #46277 from zjj2wry/credentials
Automatic merge from submit-queue (batch tested with PRs 46252, 45524, 46236, 46277, 46522)

add test in create authinfo

**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**:

```release-note
NONE
```
2017-05-26 19:48:01 -07:00
Kubernetes Submit Queue 72a398240c Merge pull request #46272 from zjj2wry/selector
Automatic merge from submit-queue (batch tested with PRs 46450, 46272, 46453, 46019, 46367)

add test for set selector

**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**:

```release-note
NONE
```
2017-05-26 18:48:58 -07:00
Kubernetes Submit Queue 899b6c00ba Merge pull request #45809 from CaoShuFeng/non-resource-url-create-rolebinding
Automatic merge from submit-queue

support NonResourceURL for kubectl create clusterrole

Release note:
```release-note
add --non-resource-url to kubectl create clusterrole
```
2017-05-26 16:47:06 -07:00
Kubernetes Submit Queue f3406bfe16 Merge pull request #42256 from shiywang/edit
Automatic merge from submit-queue (batch tested with PRs 42256, 46479, 45436, 46440, 46417)

Add `kubectl apply edit-last-applied` subcommand

third command of https://github.com/kubernetes/community/pull/287
Fixes https://github.com/kubernetes/kubernetes/issues/44905
@pwittrock @AdoHe @ymqytw @kubernetes/sig-cli-feature-requests could you guys have an early review ? cause some of feature I'm not sure about, will add unit tests if you think it's ok.
2017-05-26 15:58:57 -07:00
Kubernetes Submit Queue 00acd84b28 Merge pull request #45645 from zjj2wry/kubectl-create-quota
Automatic merge from submit-queue (batch tested with PRs 46383, 45645, 45923, 44884, 46294)

Fix test not use test flags

**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**:
old code not use test.flags, now use it

**Release note**:

```release-note
```
2017-05-26 12:58:00 -07:00
Kubernetes Submit Queue 37e95db803 Merge pull request #45422 from suyogbarve/set_resources_test
Automatic merge from submit-queue

test case for set_resources

PR adds basic unit test for set_resources.go
2017-05-26 11:50:47 -07:00
Arthur Miranda 83fec5bafb Add `kubeclt config rename-context`
Enables renaming of a context via `kubectl`

Fix https://github.com/kubernetes/kubernetes/issues/45131
2017-05-26 15:49:30 -03:00
Bryan Boreham 219cebecf7 Don't print "running in local/dry-run mode..." at the top
because the user may be trying to pipe the output of this command as
the input to another. This makes `set subject` and `set resources`
consistent with all similar commands in this directory.

Signed-off-by: Bryan Boreham <bryan@weave.works>
2017-05-26 13:34:31 +00:00
zhengjiajin ba555314d3 add test for kubectl create pdb 2017-05-26 17:38:26 +08:00
Cao Shufeng 93e50b167e support NonResourceURL for kubectl create clusterrole 2017-05-26 10:07:44 +08:00
Shiyang Wang 4597658cb9 add `kubectl apply edit-last-applied` subcommand 2017-05-26 00:20:48 +08:00
Michail Kargakis 9190a47c37
Generated changes for collision count
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 12:23:17 +02:00
Michail Kargakis fcf68ba7a7
Remove obsolete deployment helpers
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 11:17:44 +02:00
zhengjiajin 98ee2463ec add test fot set selector 2017-05-24 13:08:43 +08:00
Kubernetes Submit Queue 8e87c02959 Merge pull request #46139 from monopole/removeDepOnPkgHelper
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

Remove kubectl's dependence on pkg/api/helper

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

Remove kubectl's dependence on pkg/api/helper, as part of
broader effort to isolate kubectl from the rest of k8s.
In this case, the code becomes private to kubectl; nobody else uses it.

**Which issue this PR fixes**

Part of a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-23 19:42:59 -07:00
Kubernetes Submit Queue f30443cacc Merge pull request #42042 from perotinus/svcaccounts
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

[Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers.

Fixes #41267.

Release notes:
```release-note
Modifies kubefed to create and the federation controller manager to use credentials associated with a service account rather than the user's credentials.
```
2017-05-23 19:42:57 -07:00
zhengjiajin 61e5b5815d Fix test not use test flags 2017-05-24 10:14:00 +08:00
zhengjiajin 802362007e add test in create authinfo 2017-05-24 10:01:45 +08:00
Anirudh 078f9566d9 PDB MaxUnavailable: kubectl changes 2017-05-23 07:18:44 -07:00
Kubernetes Submit Queue 4871f4a75b Merge pull request #45637 from xilabao/hide-api-version
Automatic merge from submit-queue

remove --api-version
2017-05-23 06:15:45 -07:00
Kazuki Suda feb8148796 Add statefulset to the completion candidates of kubectl scale 2017-05-23 21:17:33 +09:00
Kubernetes Submit Queue 644a544d62 Merge pull request #46062 from alexandercampbell/correct-deprecation-errors
Automatic merge from submit-queue (batch tested with PRs 46201, 45952, 45427, 46247, 46062)

kubectl: fix deprecation warning bug

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

Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl resize [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 resize [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.

**Release note**:

```release-note
NONE
```
2017-05-22 20:58:07 -07:00
Kubernetes Submit Queue c6cf666fa1 Merge pull request #45308 from fabianofranz/more_cmd_sanity_checks
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

More cli sanity verifications

Adds some more `kubectl` command sanity checks to improve consistency and avoid the need of code reviews for some of our CLI style and standards.

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cli-pr-reviews
2017-05-22 19:59:59 -07:00
Kubernetes Submit Queue 199465c3a5 Merge pull request #43663 from shiywang/quato
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

Fix command exec -- COMMAND can not contain spaces

Fixes https://github.com/kubernetes/kubernetes/issues/7688
the problem is when you execute command:
 `cluster/kubectl.sh exec -p client-blue-8yw37 -c client -i -t -- 'ls -t /usr'`
the args is 
[`client-blue-8yw37` , `ls -t /usr`] 
**instead of** 
[`client-blue-8yw37`, `ls`, `-t`, `/usr`]
@kubernetes/sig-cli-pr-reviews, so I add a warning, wdyt ?
cc @ymqytw @adohe @fabianofranz
2017-05-22 19:07:12 -07:00
Roberto J Rojas e24384643e kubectl: fixes issues #45736 and #45737
Adds long description from #45902
2017-05-22 18:57:11 -04:00
Alexander Campbell c9c8d61048 Merge branch 'master' into correct-deprecation-errors 2017-05-22 09:55:07 -07:00
Kubernetes Submit Queue cdbfec3148 Merge pull request #43501 from xingzhou/kube-43126
Automatic merge from submit-queue

Use TabWriter to keep output of "kubectl get xx -w" aligned.

Use TabWriter to keep output of "kubectl get xx -w" aligned.

fixed #43126
2017-05-22 00:22:40 -07:00
Jeffrey Regan 5a9b06b717 **What this PR does / why we need it**:
Remove kubectl's dependence on pkg/api/helper, as part of
broader effort to isolate kubectl from the rest of k8s.
In this case, the code becomes private to kubectl; nobody else uses it.

**Which issue this PR fixes**

Part of a series of PRs to address kubernetes/community#598

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-05-21 20:44:21 -07:00
Jonathan MacMillan af2a8f7e8a [Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers. 2017-05-19 18:05:09 -07:00
Fabiano Franz 18cb56bf78 kubectl plugins have access config, global flags and environment 2017-05-19 19:17:43 -03:00
Alexander Campbell 5e1a3fd020 kubectl: improve deprecatedAlias unit test
Two new behaviors are tested:

 1. The output message that deprecatedAlias gives when it is called must
    include the word "deprecatated" and the name of the new function
    that the user should use instead.
 2. The correct function must be called by the alias (alias should "fall
    back" to the functionality of the original.
2017-05-19 14:49:03 -07:00
Fabiano Franz da85262f70 Adds support to a tree hierarchy of kubectl plugins 2017-05-19 18:06:15 -03:00
Alexander Campbell ca899ec048 kubectl: write unit test for deprecatedAlias() 2017-05-19 11:25:11 -07:00
Alexander Campbell 2f0faedbee kubectl: make "Deprecated" a private function
There's no reason to export this function, so I've made it private.
2017-05-19 10:45:49 -07:00
Alexander Campbell bf2fc62144 kubectl: renmae deprecatedCmd -> deprecatedAlias
This will clear up some of the confusion around the deprecatedCmd /
Deprecated function.
2017-05-19 10:40:21 -07:00
Alexander Campbell b3fc6556e4 kubectl: improve docstring on deprecatedCmd 2017-05-19 08:55:12 -07:00
zhengjiajin ddcbc47f18 add test for set image validation 2017-05-19 12:15:49 +08:00
Waseem Ahmad 958a7113de Use variadic nature of *cobra.Command.AddCommand to add group of commands to a parent command
Rather than looping over commands in a group and add it one by one to a
parent command, use variadic nature of *cobra.Command.AddCommand to add
the group of commands to the parent.
2017-05-19 08:38:35 +05:30
xilabao e0b4f3f73c remove --api-version 2017-05-19 10:56:35 +08:00
Alexander Campbell 9e7f29c3fb cmd: fix deprecation warning bug
Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl scale [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 scale [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.
2017-05-18 16:48:13 -07:00
Fabiano Franz 3bb04c67cc More cli sanity verifications 2017-05-18 15:44:49 -03:00
zhengjiajin 9ecab7e20c clean up: put test description in head to locate quickly 2017-05-19 02:04:59 +08:00
Kubernetes Submit Queue 212150b66a Merge pull request #45582 from CaoShuFeng/kubectl_set
Automatic merge from submit-queue

avoid concrete examples for missingResourceError

missingResourceError uses pod and services as an example in error message. However some sub-commands doesn't support pod/service, this change use `<resource> <name>` instead of concrete examples.
Before this change:
```console
$ kubectl set subject
error: You must provide one or more resources by argument or filename.
Example resource specifications include:
   '-f rsrc.yaml'
   '--filename=rsrc.json'
   'pods my-pod'
   'services'
```

After this change:
```console
$ kubectl set subject
error: You must provide one or more resources by argument or filename.
Example resource specifications include:
   '-f rsrc.yaml'
   '--filename=rsrc.json'
   '<resource> <name>'
   '<resource>'
```

**Release note**:

```release-note
avoid concrete examples for missingResourceError
```
2017-05-18 00:37:08 -07:00
Kubernetes Submit Queue 6e12c4cdbd Merge pull request #45890 from zjj2wry/xx
Automatic merge from submit-queue (batch tested with PRs 45977, 45890)

add test to cover more in kubectl create service

**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**:

```release-note
```
2017-05-17 15:39:04 -07:00
Kubernetes Submit Queue 4a9a702ee1 Merge pull request #45926 from MrHohn/api-annotations-move
Automatic merge from submit-queue

Move all API related annotations into annotation_key_constants.go

Separate from #45869. See https://github.com/kubernetes/kubernetes/pull/45869#discussion_r116839411 for details.

This PR does nothing but move constants around :)

/assign @caesarxuchao 

**Release note**:

```release-note
NONE
```
2017-05-17 10:34:53 -07:00
deads2k edd2d973a3 stop setting bad defaults that are indistinguishable from real values for clients 2017-05-17 07:18:34 -04:00
deads2k 75bd27a595 remove unnessary confusion of dead values 2017-05-17 07:15:29 -04:00
Zihong Zheng 5992425588 Autogenerated files 2017-05-16 21:55:51 -07:00
Zihong Zheng c0920f75cf Move API annotations into annotation_key_constants and remove api/annotations package 2017-05-16 21:55:23 -07:00
Kubernetes Submit Queue 79dae5c092 Merge pull request #45810 from superbrothers/expand-env-vals
Automatic merge from submit-queue (batch tested with PRs 45247, 45810, 45034, 45898, 45899)

kubectl plugin: Expand environment variables in the command of plugin.yaml

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

This commit improves kubectl plugins to expand environment variables in the command of plugin.yaml.
I'd like to use environment variables in the command of plugin.yaml as follows:
```yaml
name: hello
shortDesc: "The hello plugin"
longDesc: >
  The hello plugin is a new
  plugin used by test-cmd
  to test multiple plugin locations.
command: $HOME/path/to/plugins/hello.sh
```

**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**:

```release-note
NONE
```
2017-05-16 19:01:57 -07:00
zhengjiajin 735e32ef83 add test to cover more in kubectl create service 2017-05-16 18:45:38 +08:00
Kubernetes Submit Queue 15a8ab33b8 Merge pull request #44915 from xiangpengzhao/fix-kubectl-run-pod-label
Automatic merge from submit-queue

Assign label to pod when exec 'kubectl run' command with flags "--expose=true" and "--restart=Never"

**What this PR does / why we need it**:
As the title says and issue #40503 mentioned.
cc @tanapoln 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-15 21:52:45 -07:00
Kubernetes Submit Queue 560323ad9b Merge pull request #45389 from monopole/isolation1
Automatic merge from submit-queue (batch tested with PRs 45835, 45389)

Introduce visibility rules to kubernetes code.

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

Use rules to identify "bad" dependencies on kubectl code for later refactoring or removal, and prevent their reintroduction.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 19:34:52 -07:00
Cao Shufeng b53ae95e84 modify the example part of missingResourceError
"missingResourceError" is a generic error for kubectl, so we should
not use concrete examples in the error message.
2017-05-16 09:37:37 +08:00
Chao Xu 36e2d0b4cb hack/update-bazal.sh
hack/update-godep-license
2017-05-15 13:51:39 -07:00
Chao Xu d9c2fbbf23 rely on staging/metrics instead of on
vendor/k8s.io/heapster/metrics/apis/metrics/v1alpha1

fix some related imports
2017-05-15 13:50:49 -07:00
Jeffrey Regan 7abff879d7 Introduce visibility rules to kubernetes code.
**What this PR does / why we need it**:

Visibility rules allow dependency control.  The rules currently in
place make all targets public, to override the default state of
private.  This PR removes public visibility from kubectl code.  It
uses specially named pacakge groups to identify "bad" dependencies on
kubectl code for later refactoring or removal.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 12:50:56 -07:00
shiywang 6d44c8417d Fix command exec -- COMMAND can not contain spaces, update help information 2017-05-15 23:47:17 +08:00
Dmitry Shulyak 2612e0c78a Move client/unversioned/remotecommand to client-go
Module remotecommand originally part of kubernetes/pkg/client/unversioned was moved
to client-go/tools, and will be used as authoritative in kubectl, e2e and other places.

Module remotecommand relies on util/exec module which will be copied to client-go/pkg/util
2017-05-15 16:28:56 +03:00
Kazuki Suda 9a36d5567a kubectl plugin: Expand environment variables in the command of plugin.yaml
This commit improves kubectl plugins to expand environment variables in
the command of plugin.yaml.
2017-05-15 15:54:47 +09:00
Kubernetes Submit Queue ad6a9bb78e Merge pull request #44950 from xilabao/use-StringArrayVar-for-ResourceName
Automatic merge from submit-queue

use StringArrayVar for ResourceName

ref to https://github.com/kubernetes/kubernetes/pull/43903

```release-note
`kubectl create role` and `kubectl create clusterrole` no longer allow specifying multiple resource names as comma-separated arguments. Use repeated `--resource-name` arguments to specify multiple resource names. 
```
2017-05-14 19:39:52 -07:00
Ahmet Alp Balkan f39afd4eeb
Differentiate update/create message on set-context
kubectl config set-context prints the same message (Context %q set) for both
new and existing contexts. This patch helps differentiate whether an existing
context is modified or a new context is created.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-12 18:22:02 -07:00
Kubernetes Submit Queue b4b5bfdb46 Merge pull request #45648 from karataliu/fixtmpdir
Automatic merge from submit-queue

Fix hardcoded tmp dir path in kubectl test.

**What this PR does / why we need it**:
Current case uses hardcoded tmp dir path, and it does not delete tmp dir after test run.

Which means 1. The case could not be run by different users (no permission) 2. /tmp dir keeps growing.

**Which issue this PR fixes** 

**Special notes for your reviewer**:

**Release note**:
2017-05-12 06:10:17 -07:00
Kubernetes Submit Queue 230d2473db Merge pull request #45698 from zjj2wry/nnn
Automatic merge from submit-queue (batch tested with PRs 45691, 45667, 45698, 45715)

testName to head

**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**:
testName in head, may be can quick location

**Release note**:

```release-note
```
2017-05-12 04:09:43 -07:00
Kubernetes Submit Queue fab3d23bcf Merge pull request #45669 from danwinship/kubectl-plugin-dirs
Automatic merge from submit-queue (batch tested with PRs 45684, 45266, 45669, 44787, 44984)

Fix XDG-based kubectl plugin dirs

XDGDataPluginLoader messed up its default-value handling for `XDG_DATA_DIRS` and ends up scanning *all of /usr/share* looking for plugins if you don't have that set :-O

/release-note-none
/assign @fabianofranz
2017-05-12 03:20:40 -07:00
Dong Liu 42f600870e Fix hardcoded tmp dir path in kubectl test. 2017-05-12 16:07:58 +08:00
xilabao 61e53998e5 ResourceName could possibly contain a comma should use StringArray, not StringSlice 2017-05-12 13:11:21 +08:00
Kubernetes Submit Queue ed4b25e46e Merge pull request #45406 from xilabao/fix-impersonate-in-create-role
Automatic merge from submit-queue

fix specialized verbs in create role
2017-05-11 20:18:12 -07:00
Dan Winship 415fe52790 Fix XDG-based kubectl plugin dirs 2017-05-11 13:28:28 -04:00
deads2k e91716a2db orphan when kubectl delete --cascade=false 2017-05-11 09:11:07 -04:00
zhengjiajin 77c207b424 small change to clear 2017-05-11 20:09:31 +08:00
xilabao 02deeb224e fix specialized verbs in create role 2017-05-11 09:32:43 +08:00
Alexander Staubo 4f8cbc15ac kubectl: 'apply view-last-applied' must not use printf(), as this will cause format codes in the YAML/JSON to be interpreted. 2017-05-10 16:17:12 -04:00
Shiyang Wang d43f4bb3b6 refactor functions in editoptions.go to use less arguments 2017-05-10 16:46:04 +08:00
Kubernetes Submit Queue 148b5da60b Merge pull request #44746 from xiangpengzhao/fix-podpreset
Automatic merge from submit-queue

Add support for PodPreset in `kubectl get` command

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-09 21:16:17 -07:00
xiangpengzhao baafbf406e Add support for PodPreset in kubectl get command 2017-05-10 08:59:22 +08:00
Kubernetes Submit Queue ceff8d8d4d Merge pull request #45320 from pwittrock/junit
Automatic merge from submit-queue (batch tested with PRs 45508, 44258, 44126, 45441, 45320)

Print a newline after ginkgo tests so the test infra doesn't think th…

Fixes #45279

Print a newline after ginkgo tests so the test infra doesn't think that they fail

```release-note
NONE
```
2017-05-08 16:34:48 -07:00
zhangxiaoyu-zidif 276a272a91 fmt.Errorf replaces errors 2017-05-09 06:26:45 +08:00
Seth Jennings 77ac3290d6 check for walkErr before fileInfo deref 2017-05-08 13:39:01 -05:00
Kubernetes Submit Queue 08a030f464 Merge pull request #45088 from xilabao/add-validate-in-create-rolebinding
Automatic merge from submit-queue

add validate in create rolebinding
2017-05-08 06:21:49 -07:00
xilabao 0c0a32d870 add validate in create rolebinding 2017-05-08 15:52:44 +08:00
Kubernetes Submit Queue 79a2e359cd Merge pull request #44024 from zhangxiaoyu-zidif/egnew
Automatic merge from submit-queue

fix the typos of e.g.

fix the typos of e.g.


**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**:

```release-note
```
2017-05-05 23:41:33 -07:00
Suyog Barve 89ffe55c52 test case for set_resources
test case for set_resources updated BUILD file

update BUILD file as per update-bazel.sh
2017-05-05 19:46:57 -05:00
mbohlool ea042c6ca0 Update go-restful dependency 2017-05-05 13:57:01 -07:00
Kubernetes Submit Queue cc1f9f7254 Merge pull request #44740 from ravisantoshgudimetla/kubectl_taints_label_selector#44522
Automatic merge from submit-queue

Kubectl taint node based on label selector

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes  #44522
**Release note**:
```
Taints the node based on label selector
```
2017-05-05 09:25:02 -07:00
Kubernetes Submit Queue 4e74c43e9a Merge pull request #43436 from xilabao/add-set-rolebinding-command
Automatic merge from submit-queue

add set rolebinding/clusterrolebinding command

add command to set user/group/serviceaccount in rolebinding/clusterrolebinding /cc @liggitt @deads2k
2017-05-05 07:21:58 -07:00
xilabao 20876757c2 add set rolebinding/clusterrolebinding command 2017-05-05 09:55:35 +08:00
Phillip Wittrock 83ff8f2d6c Print a newline after ginkgo tests so the test infra doesn't think that they fail
Fixes #45279
2017-05-04 16:20:53 -07:00
Chao Xu bbb94e42c1 remove registry from testing/fixture.go; update client-gen to not use
registry in the generated clients
2017-05-04 11:30:51 -07:00
Suyog Barve 05131c627f use of --local should completely eliminate communication with API server
fix testcase use of --local should completely eliminate communication with API server
2017-05-03 15:57:57 -05:00
Kubernetes Submit Queue 4ff9234eec Merge pull request #44908 from suyogbarve/proxybug
Automatic merge from submit-queue

allow kubectl proxy to handle specified reject methods and default to…

What this PR does / why we need it:
"kubect proxy" command had a bug and was not supporting feature to reject http methods
--reject-methods='POST,PUT,PATCH'
this was due to missing filter for RejectMethods in kubectl/cmd/proxy.go
This PR adds the desired flag, however to retain the current behaviour of "kubectl proxy" the Default Rejected methods are changed from 'POST,PUT,PATCH' to '^$' i.e. none.

Issue not created and no existing issue found
2017-05-03 08:55:18 -07:00
Dr. Stefan Schimanski 20df61009d Get rid of meta.KindToResource in rollingupdate 2017-05-03 09:49:02 +02:00
Cao Shufeng de3db1eec3 add subresource support to kube auth can-i
Eg:
    kubectl auth can-i get pods --subresource=log
2017-05-02 12:08:20 +08:00
Suyog Barve f3a7ac4311 allow kubectl proxy to handle specified reject methods and default to allow all 2017-04-29 21:10:52 -05:00
Kubernetes Submit Queue 3a2a01bddc Merge pull request #44930 from fabianofranz/issue_44832
Automatic merge from submit-queue (batch tested with PRs 44044, 44766, 44930, 45109, 43301)

Fixes get -oname for unstructured objects

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

Make sure we display kind in `kubectl get -o name` for unknown resource types.

**Release note**:

```release-note
NONE
```
2017-04-28 17:49:10 -07:00
Kubernetes Submit Queue 0afab578d8 Merge pull request #44952 from CaoShuFeng/proxy_reject_path
Automatic merge from submit-queue

Log warning when invalid dir passed to kubectl proxy --www

**Release note**:

```
Log warning when invalid directory is passed to `kubectl proxy --www`
```
2017-04-28 14:00:20 -07:00
Kubernetes Submit Queue d4ece0abc3 Merge pull request #37499 from fabianofranz/kubectl_plugins
Automatic merge from submit-queue

kubectl binary plugins

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

Introduces the ability to extend `kubectl` by adding third-party plugins that will be exposed through `kubectl`.

Plugins are executable commands written in any language. To be included as a plugin, a binary or script file has to

1. be located under one of the supported plugin path locations:
1.1 `~/.kubectl/plugins` dir
1.2. one or more directory set in the `KUBECTL_PLUGINS_PATH` env var
1.3. the `kubectl/plugins` dir under one or more directory set in the `XDG_DATA_DIRS` env var, which defaults to `/usr/local/share:/usr/share`
2. in any of the plugin path above, have a subfolder with the plugin file(s)
3. in the subfolder, contain at least a `plugin.yaml` file that describes the plugin

Example:

```
$ cat ~/.kube/plugins/myplugin/plugin.yaml
name: "myplugin"
shortDesc: "My plugin's short description"
command: "echo Hello plugins!"

$ kubectl myplugin
Hello plugins!
```

~~In case the plugin declares `tunnel: true`, the plugin engine will pass the `KUBECTL_PLUGIN_API_HOST` env var when calling the plugin binary. Plugins can then access the Kube REST API in "http://$KUBECTL_PLUGIN_API_HOST/api" using the same context currently in use by `kubectl`.~~

Test plugins are provided in `pkg/kubectl/plugins/examples`. Just copy (or symlink) the files to `~/.kube/plugins` to test.

**Which issue this PR fixes**:

Related to the discussions in the proposal document: https://github.com/kubernetes/kubernetes/pull/30086 and https://github.com/kubernetes/community/pull/122.

**Release note**:
```release-note
Introduces the ability to extend kubectl by adding third-party plugins. Developer preview, please refer to the documentation for instructions about how to use it.
```
2017-04-28 12:23:59 -07:00
Fabiano Franz 1aa84d101a Fixes get -oname for unstructured objects 2017-04-28 14:12:36 -03:00
Kubernetes Submit Queue d6fd997d44 Merge pull request #41530 from bruceauyeung/k8s-branch-do-not-use-underscores-in-go-variable-names
Automatic merge from submit-queue

rename variables to make sure that they conform to golang variable name conventions

rename variables to make sure that they conform to golang variable name conventions

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

there are lots of package level unexported variables in package `cmd` not conforming golang variable name conventions, such as `version_example`, in this PR i rename all of them to make sure that they conform to golang variable name conventions
2017-04-28 09:28:13 -07:00
ravisantoshgudimetla 081ba02fa5 Changes to kubectl taint to respect selector flag 2017-04-28 10:28:26 -04:00
Fabiano Franz 2158473474 Plugins are loaded under the 'kubectl plugin' command 2017-04-28 01:34:07 -03:00
Fabiano Franz 2b178ad608 Basic support for kubectl plugins 2017-04-28 01:34:07 -03:00
Kubernetes Submit Queue 65838085b0 Merge pull request #43618 from xilabao/fix-kubectl-run-output
Automatic merge from submit-queue (batch tested with PRs 44970, 43618)

fix kubectl run output

fixes https://github.com/kubernetes/kubernetes/issues/40440
2017-04-26 22:58:13 -07:00
Kubernetes Submit Queue 433aec11c8 Merge pull request #44531 from pwittrock/kubectl-openapi
Automatic merge from submit-queue

OpenAPI support for kubectl

Support for openapi spec in kubectl.

Includes:
- downloading and caching openapi spec to a local file
- parsing openapi spec into binary serializable datastructures (10x faster load times 600ms -> 40ms)
- caching parsed openapi spec in memory for each command

```release-note
NONE
```
2017-04-26 16:59:17 -07:00
Cao Shufeng 3cfaf3049b Log warning when invalid dir passed to kubectl proxy --www 2017-04-26 17:53:54 +08:00
xiangpengzhao 0b8e25cdbf Assign label to pod when exec 'kubectl run' command with flags "--expose=true" and "--restart=Never" 2017-04-26 11:53:33 +08:00
Kubernetes Submit Queue b7f890fc96 Merge pull request #44607 from supereagle/update-kubectl-apply-doc
Automatic merge from submit-queue (batch tested with PRs 44607, 44472, 44482)

update kubectl apply doc for required resource name

**What this PR does / why we need it**:
Update kubectl apply doc to illustrate that the resource name is required.

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

**Special notes for your reviewer**:
@liggitt @adohe @jayunit100

**Release note**:

```release-note
```
2017-04-25 14:47:37 -07:00
Kubernetes Submit Queue 5d2be22d3e Merge pull request #44893 from zhangxiaoyu-zidif/fix-configmap-format
Automatic merge from submit-queue (batch tested with PRs 44601, 44842, 44893, 44491, 44588)

secret.go: add initial symbol and format err

secret.go: add initial symbol and format err
line 198: add initialization symbol 
other lines: format err.
2017-04-25 12:51:37 -07:00
Phillip Wittrock 21e239fb82 kubectl OpenAPI bazel updates 2017-04-25 10:45:50 -07:00
Phillip Wittrock 212c2a3a72 kubectl OpenAPI support 2017-04-25 10:45:49 -07:00
Kubernetes Submit Queue 1fd19f7fa2 Merge pull request #42477 from jsafrane/v1-2-new-api
Automatic merge from submit-queue (batch tested with PRs 42477, 44462)

Use storage.v1 instead of v1beta1

storage.v1beta1 was used to work around GKE which did not expose v1. Now that GKE is updated, we can switch everything to v1.

This is simple sed v1beta1 -> v1 + enabled a new test + changed preference of exposed interfaces in `storage/install/install.go`.

@msau42, PTAL and let me know when GKE is updated with storage v1 API and this PR can be actually merged.

@kubernetes/sig-storage-pr-reviews 

```release-note
NONE
```
2017-04-25 10:25:44 -07:00
Kubernetes Submit Queue 51fe7d2ba1 Merge pull request #44693 from xilabao/remove-incorrect-validate-in-create-role
Automatic merge from submit-queue

remove resourcename validation in create role

@liggitt Since #44659 is not correct. I think we should fix the validation in create role command.
2017-04-25 08:13:36 -07:00
supereagle d9d2a72d9c update kubectl apply doc for required resource name 2017-04-25 19:22:08 +08:00
Jan Safranek 9d0c47f1db Use storage.v1 instead of v1beta1
storage.v1beta1 was used to work around GKE which does not expose v1. Now that
GKE is updated, we can switch everything to v1.
2017-04-25 10:13:38 +02:00
bruceauyeung ab4029c85b Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
rename variables to make sure that they conform to golang variable name convention
2017-04-25 15:07:01 +08:00
Kubernetes Submit Queue f4b1968b91 Merge pull request #44207 from shiywang/hotfix
Automatic merge from submit-queue

Add --all support for view-last-applied 

Fixes https://github.com/kubernetes/kubernetes/issues/44195
sorry for my careless, and thanks for the review, @ymqytw ptal
2017-04-24 20:25:48 -07:00
zhangxiaoyu-zidif 50d3909dd5 secret.go: add initial symbol and format err 2017-04-25 10:47:50 +08:00
Kubernetes Submit Queue 390e98721f Merge pull request #42241 from xiangpengzhao/shortname-np
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Add short name "netpol" for networkpolicies

**What this PR does / why we need it**:
Add short name for `networkpolicies` in kubectl command for good user experience.

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

**Special notes for your reviewer**:
None

**Release note**:

```release-note
Add short name "netpol" for networkpolicies
```
2017-04-24 19:39:40 -07:00
xilabao 7bd9ddef60 remove resourcename validation in create role 2017-04-25 09:22:02 +08:00
Kubernetes Submit Queue ed539fb76f Merge pull request #39404 from adohe/refactor_edit
Automatic merge from submit-queue

add EditOptions to make edit reusable

FYI. Added `EditOptions` to decouple edit implementation from cobra command, thus make edit reusable. Once this get merged, we can refactor `create` commands to put them in their own package. @kubernetes/sig-cli-misc please give a quick review, and I would like to get this merged asap.
2017-04-24 16:20:39 -07:00
Kubernetes Submit Queue f0ce5bd8d8 Merge pull request #44672 from kargakis/update-deployment-completeness
Automatic merge from submit-queue (batch tested with PRs 43575, 44672)

Update deployment and daemonset completeness checks

maxUnavailable being taken into account for deployment completeness has caused a lot of confusion (https://github.com/kubernetes/kubernetes/issues/44395, https://github.com/kubernetes/kubernetes/issues/44657, https://github.com/kubernetes/kubernetes/issues/40496, others as well I am sure) so I am willing to just stop using it and require all of the new Pods for a Deployment to be available for the Deployment to be considered complete (hence both `rollout status` and ProgressDeadlineSeconds will not be successful in cases where a 1-pod Deployment never becomes successful because its Pod never transitions to ready).

@kubernetes/sig-apps-api-reviews thoughts?
```release-note
Deployments and DaemonSets are now considered complete once all of the new pods are up and running - affects `kubectl rollout status` (and ProgressDeadlineSeconds for Deployments)
```
Fixes https://github.com/kubernetes/kubernetes/issues/44395
2017-04-24 10:34:00 -07:00
Kubernetes Submit Queue 260e213f26 Merge pull request #44845 from zhangxiaoyu-zidif/fix-configmap-test
Automatic merge from submit-queue

configmap.go: add one initialization symbol
2017-04-24 07:56:09 -07:00
Kubernetes Submit Queue b26d902070 Merge pull request #43517 from zjj2wry/007
Automatic merge from submit-queue

unit test for kubectl config set

**What this PR does / why we need it**:
unit test for kubectl config set

**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**:
think you

**Release note**:

```release-note
```
2017-04-24 06:27:52 -07:00
zhangxiaoyu-zidif b5c1aa5210 configmap.go: add one initialization symbol 2017-04-24 21:26:32 +08:00
xilabao 19217bc4a2 support subresource when running kubectl create role 2017-04-24 10:05:47 +08:00
Kubernetes Submit Queue e7ca665a0d Merge pull request #43896 from CaoShuFeng/list-meta
Automatic merge from submit-queue

Reorganize the output of "kubectl get -o json"

"resourceVersion" and "selfLink" are members of "metadata" rather than
the list. This change reorganize the struct to provide consistency with
other places.

Before this change:
```json
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
```
After this change:
```json
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
```

Reference:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L57



**Release note**:

```release-note
NONE
```
2017-04-23 10:14:41 -07:00
Kubernetes Submit Queue c289286647 Merge pull request #42612 from CaoShuFeng/create_role_trival
Automatic merge from submit-queue

add "bind" to validResourceVerbs in "create role" cli 

"bind" and "impersonate" are also a legal verbs according this:
https://github.com/kubernetes/kubernetes.github.io/pull/2771/files
**Release note**:

```NONE
```
2017-04-22 12:18:00 -07:00
Michail Kargakis 0a59f6c487
Revert respecting maxUnavailable for DaemonSets
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-04-22 17:18:09 +02:00
Michail Kargakis 1923cc60c9
Revert "kubectl: respect deployment strategy parameters for rollout status"
This reverts commit d20ac8766e.
2017-04-22 17:18:06 +02:00
Kubernetes Submit Queue af57b82bfc Merge pull request #40784 from adamreese/fix/clientcache-threadsafe
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

make kubectl clientcache thread safe

**What this PR does / why we need it**:
Prevent panics when accessing kubectl client cache concurrently.

**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/helm/issues/1879
2017-04-21 11:52:05 -07:00
Kubernetes Submit Queue f613e66ad6 Merge pull request #44543 from xilabao/fix-warning-in-auth
Automatic merge from submit-queue

remove warning infomation when using '*'

```
#kubectl auth can-i "*" "*"
Warning: the server doesn't have a resource type '*'
yes
```
2017-04-21 10:12:56 -07:00
shiywang 03a58ceeaa Add --all support for view-last-applied 2017-04-21 08:45:30 +08:00
Kubernetes Submit Queue 2c6fbc95c4 Merge pull request #43171 from ravisantoshgudimetla/kubectl_taints_ux
Automatic merge from submit-queue

Refactoring reorganize taints function in kubectl to expose operations

**What this PR does / why we need it**:
This adds some UX functionality when specifying taints using kubectl.
For example:
```
./kubectl.sh taint nodes XYZ dedicated1=abca2:NoSchedule 
node "XYZ" tainted
 ./kubectl.sh taint nodes XYZ dedicated1=abca1:NoSchedule --overwrite=True
node "XYZ overwritten
./kubectl.sh taint nodes XYZ dedicated1-
node "XYZ" untainted
./kubectl.sh taint nodes XYZ dedicated=abca1:NoSchedule dedicated1-
node "XYZ" modified
```
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #43167 

**Release note**:
```
Fixed the output of kubectl taint node command with minor improvements.
```
2017-04-20 04:17:18 -07:00
Adam Reese 15fa01410b make kubectl clientcache thread safe 2017-04-18 15:31:52 -07:00
Kubernetes Submit Queue fab2f5e3af Merge pull request #44267 from zjj2wry/005-f
Automatic merge from submit-queue (batch tested with PRs 43000, 44500, 44457, 44553, 44267)

add kubectl config view test code

**What this PR does / why we need it**:
kubectl config view test code

**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**:
think you very much :)

**Release note**:

```release-note
```
2017-04-18 13:19:12 -07:00
Kubernetes Submit Queue 1ee8f2f543 Merge pull request #44088 from xingzhou/kube-44069
Automatic merge from submit-queue

Fixed `kubectl cluster-info dump` to support multi-container pod.

Fixed `kubectl cluster-info dump` to support multi-container pod.

**Release note**:
```
Improve `kubectl cluster-info dump` to support multi-container pod information dump.
```

Fixed #44069
2017-04-18 07:42:14 -07:00
AdoHe 5ed1ab66a2 refactor edit to remove cobra dependency and also make it reusable 2017-04-18 20:44:25 +08:00
xilabao d3d33aa834 remove warning infomation when use '*' 2017-04-18 16:10:21 +08:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
ravisantoshgudimetla 5bdf79baf2 Small changes suggested by reviewers for comments and rebase 2017-04-17 12:57:27 -04:00
zhengjiajin d5a3c22cb8 add test code for kubectl config set 2017-04-17 16:20:33 +08:00
Chao Xu d4850b6c2b move pkg/api/v1/helpers.go to subpackage 2017-04-14 14:25:11 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Cao Shufeng a6db26d5b7 Reorganize the output of "kubectl get -o json"
"resourceVersion" and "selfLink" are members of "metadata" rather than
the list. This change reorganize the struct to provide consistency with
other places.

Before this change:
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
After this change:
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }

Reference:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L57
2017-04-14 11:08:34 +08:00
Kubernetes Submit Queue ab22baf94d Merge pull request #44299 from caesarxuchao/move-ref.go
Automatic merge from submit-queue (batch tested with PRs 44406, 41543, 44071, 44374, 44299)

Move pkg/api/ref.go to a subpackage

First commit is #44296. (unfortunately, removing that commit results in conflicts)

This PR moves the pkg/api/ref.go to its own subpackage. It's mostly a mechanic move.

I'll send a few more PRs to make the k8s.io/kubernetes/pkg/api package only contains the code we want in the k8s.io/api repo, then we can run a [script](a0015fd1be (diff-7a2fbb4371972350ee414c6b88aee1c8)) to cut the new repo.
2017-04-13 19:52:11 -07:00
Kubernetes Submit Queue 4653a9b280 Merge pull request #41543 from dshulyak/decouple_remotecommand
Automatic merge from submit-queue (batch tested with PRs 44406, 41543, 44071, 44374, 44299)

Decouple remotecommand

Refactored unversioned/remotecommand to decouple it from undesirable dependencies:

- term package now is not required, and functionality required to resize terminal size can be plugged in directly in kubectl
- in order to remove dependency on kubelet package - constants from kubelet/server/remotecommand were moved to separate util package (pkg/util/remotecommand)
- remotecommand_test.go moved to pkg/client/tests module
2017-04-13 19:52:05 -07:00
Kubernetes Submit Queue 9f92832fad Merge pull request #43942 from wanghaoran1988/fix_43323
Automatic merge from submit-queue (batch tested with PRs 44447, 44456, 43277, 41779, 43942)

Clean up pre-ControllerRef compatibility logic

**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 #43323 

**Special notes for your reviewer**:
No
**Release note**:

```
NONE
```
2017-04-13 15:02:03 -07:00
Kubernetes Submit Queue d2733394ca Merge pull request #42144 from xilabao/add-resource-validate
Automatic merge from submit-queue

add validate to resource in can-i

```
#kubectl auth can-i get xxx
the server doesn't have a resource type "xxx"
```
2017-04-13 11:43:05 -07:00
Chao Xu d9920c53a5 move ref.go to its own subpackage 2017-04-13 10:02:43 -07:00
Kubernetes Submit Queue c3463d737e Merge pull request #44251 from superbrothers/completion-cluster-user-flags
Automatic merge from submit-queue

Support completion for --cluster and --user

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

kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```

**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**:

```release-note
Add completion support for --namespace and --cluster to kubectl
```
2017-04-13 08:42:04 -07:00
Dmitry Shulyak f50480c714 Decouple remotecommand client from term/kubelet dependencies
In order to move client/unversioned/remotecommand to client-go as a followup
for this change we have to decouple it from tons of dependencies
2017-04-13 15:56:40 +03:00
Kubernetes Submit Queue 45dc1539f3 Merge pull request #44416 from ivan4th/fix-kubectl-crash
Automatic merge from submit-queue

Fix crash in kubectl run

I observed the problem in k8s 1.5.1, but the code is still there, so fixing it.
Here's the old backtrace - happened due to network disconnection during `kubectl run`:

```
ivan4th@i4mac:~$ kubectl run --rm -it alpine1 --image=alpine:3.5 --restart=Never /bin/sh
Waiting for pod default/alpine1 to be running, status is Pending, pod ready: false
If you don't see a command prompt, try pressing enter.
/ # panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe8706]

goroutine 1 [running]:
panic(0x11e0d80, 0xc420016090)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPod.func2(0xc400000008, 0x14783a0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:432 +0x126
k8s.io/kubernetes/pkg/util/interrupt.(*Handler).Run(0xc420379230, 0xc4206c11f0, 0x0, 0x0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/util/interrupt/interrupt.go:103 +0x109
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPod(0x208c8c0, 0xc4204832c0, 0xc4204395d0, 0x7, 0xc4204395a0, 0x7, 0x1477e10, 0xc4206e6040, 0x0, 0x0, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:434 +0x49e
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPodTerminated(0x208c8c0, 0xc4204832c0, 0xc4204395d0, 0x7, 0xc4204395a0, 0x7, 0x1c48020, 0xc42002c010, 0xc420124300, 0x0, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:458 +0xea
k8s.io/kubernetes/pkg/kubectl/cmd.Run(0x1c61040, 0xc4203106e0, 0x1c47fe0, 0xc42002c008, 0x1c48020, 0xc42002c010, 0x1c48020, 0xc42002c018, 0xc42047e6c0, 0xc42006d200, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:304 +0xe37
k8s.io/kubernetes/pkg/kubectl/cmd.NewCmdRun.func1(0xc42047e6c0, 0xc42006d200, 0x2, 0x6)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:98 +0x144
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc42047e6c0, 0xc42006d140, 0x6, 0x6, 0xc42047e6c0, 0xc42006d140)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:603 +0x439
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4204dbb00, 0xc420438e50, 0x1, 0x1)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:689 +0x367
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4204dbb00, 0xc4203106e0, 0x1c47fe0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:648 +0x2b
k8s.io/kubernetes/cmd/kubectl/app.Run(0x0, 0x0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/app/kubectl.go:38 +0xd5
main.main()
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:26 +0x22
```
2017-04-13 05:56:14 -07:00
Kubernetes Submit Queue 19d722671b Merge pull request #43297 from mvdan/kubectl-params
Automatic merge from submit-queue

kubectl/cmd: remove a bunch of unused parameters

Found with github.com/mvdan/unparam.

**Release note**: NONE
2017-04-13 04:07:21 -07:00
Ivan Shvedunov b62af04f7f Fix crash in kubectl run 2017-04-13 01:00:50 +03:00
Chao Xu 08aa712a6c move helpers.go to helper 2017-04-11 15:49:11 -07:00
Kubernetes Submit Queue 785299eea5 Merge pull request #43490 from xingzhou/add-testcases
Automatic merge from submit-queue (batch tested with PRs 43304, 41427, 43490, 44352)

Supplement unit tests to `kubectl create rolebinding` command.

Supplement unit tests to `kubectl create rolebinding` command,
including:
1. Unit tests for pkg/kubectl/role.go
2. Unit tests for pkg/kubectl/cmd/create_role.go
2017-04-11 13:46:16 -07:00
Kubernetes Submit Queue 867159416f Merge pull request #44293 from deads2k/api-08-unstructureditems
Automatic merge from submit-queue (batch tested with PRs 43545, 44293, 44221, 43888)

make unstructured items correspond to other items for storage

"normal" `Items` elements include the struct itself, not a pointer to the struct.  Some of the deeper bits of storage rely on this behavior in reflective paths.

This updates the `UnstructuredList` to be "normal".

@kubernetes/sig-api-machinery-pr-reviews
2017-04-11 12:18:20 -07:00
Kubernetes Submit Queue da1fe12133 Merge pull request #43900 from CaoShuFeng/cani-quiet
Automatic merge from submit-queue (batch tested with PRs 43900, 44152, 44324)

fix return value of "kubectl auth cani --quiet"

Before this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
0

After this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
1

@deads2k 

**Release note**:

```NONE
```
2017-04-11 07:57:13 -07:00
deads2k 706823aaa8 make unstructured items correspond to other items for storage 2017-04-11 08:44:16 -04:00
Xing Zhou a08ad42848 Fixed `kubectl cluster-info dump` to support multi-container pod.
Fixed `kubectl cluster-info dump` to support multi-container pod.
2017-04-11 10:53:30 +08:00
Derek Carr 9c956c2170 Allow the usage of kubectl logs with label selector and container name 2017-04-10 13:14:47 -04:00
zhengjiajin 420da81a4b add kubectl config view test code 2017-04-10 19:36:42 +08:00
Cao Shufeng 877bf54465 add "bind" and "impersonate" to legal verbs
"bind" and "impersonate" are also legal verbs according this:
https://github.com/kubernetes/kubernetes.github.io/pull/2771/files
2017-04-10 03:46:04 -04:00
Kazuki Suda 2b1078e61e Support completion for --cluster and --user
With this commit, kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```
2017-04-09 15:11:21 +09:00
Kubernetes Submit Queue 0a7fa6926a Merge pull request #42336 from superbrothers/context-completion-for-config-use-context
Automatic merge from submit-queue (batch tested with PRs 44119, 42538, 43802, 42336, 43396)

Support context completion for kubectl config use-context

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

With this PRt, kubectl is supported context completion for config use-context.

```
$ ./kubectl config use-context
cluster01  minikube
```

/ref  #42103 

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

#29386

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-07 14:09:40 -07:00
Kubernetes Submit Queue bf766f48a6 Merge pull request #42538 from adohe/context_warning
Automatic merge from submit-queue (batch tested with PRs 44119, 42538, 43802, 42336, 43396)

print warning when delete current context

mirror update to kubectl. fix #42012 @smarterclayton ptal.

**Release Note**:
```
print warning when delete current context
```
2017-04-07 14:09:36 -07:00
Haoran Wang 866c599198 Clean up pre-ControllerRef compatibility logic 2017-04-07 14:09:23 +08:00
Brendan Burns 79f51923d3 Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
Kubernetes Submit Queue 3160d7287d Merge pull request #43903 from xilabao/use-StringArray-for-user
Automatic merge from submit-queue (batch tested with PRs 44104, 43903, 44109)

use StringArray in create rolebindings

@liggitt I think maybe you like this.

```release-note
`kubectl create rolebinding` and `kubectl create clusterrolebinding` no longer allow specifying multiple subjects as comma-separated arguments. Use repeated `--user`, `--group`, or `--serviceaccount` arguments to specify multiple subjects. 
```
2017-04-05 17:43:26 -07:00
xilabao 33e55972f4 use StringArray in create rolebindings 2017-04-05 18:44:45 +08:00
Kubernetes Submit Queue 89875ccb40 Merge pull request #43514 from zjj2wry/006
Automatic merge from submit-queue (batch tested with PRs 44047, 43514, 44037, 43467)

unit test for kubectl config use-context

**What this PR does / why we need it**:
unit test for kubectl config use-context

**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**:
think you

**Release note**:

```release-note
```
2017-04-04 14:33:22 -07:00
Daniel Martí 810dbc5e98 kubectl/cmd: remove a bunch of unused parameters
Found with github.com/mvdan/unparam.
2017-04-04 10:36:30 +01:00
Kubernetes Submit Queue e9a91b8cca Merge pull request #44020 from tpot/kubectl-cmdline-spelling-fix
Automatic merge from submit-queue (batch tested with PRs 42674, 43937, 44020)

Fix spelling of 'arguments' for kubectl create authinfo

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

Fixes a silly spelling mistake in help output.

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

**Special notes for your reviewer**:

I've signed the CLA but don't fully understand the PR process yet.  I guess the "cla:yes" label gets added by someone else or automatically by a bot?

**Release note**:

```release-note
NONE
```
2017-04-04 00:53:16 -07:00
zhangxiaoyu-zidif 932ece5cfd e3d534b2c4 2017-04-04 14:16:34 +08:00
Tim Potter 1e4c93a0f8 Fix spelling of 'arguments' for kubectl create authinfo 2017-04-04 15:17:55 +10:00
Kubernetes Submit Queue 1df2363093 Merge pull request #42999 from shiywang/fix-return0
Automatic merge from submit-queue (batch tested with PRs 43450, 42999, 43968)

fix kubectl config return 0 on error

Fixes https://github.com/kubernetes/kubernetes/issues/42852
cc @kubernetes/sig-cli-bugs
@ymqytw ptal
2017-04-03 09:48:23 -07:00
Kubernetes Submit Queue 2d646e0c29 Merge pull request #43450 from zjj2wry/003
Automatic merge from submit-queue (batch tested with PRs 43450, 42999, 43968)

unit test for kubectl config set-context

**What this PR does / why we need it**:
unit test for create context

**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**:
think you 

**Release note**:

```release-note
NONE
```
2017-04-03 09:48:21 -07:00
xilabao 53f2c2753f add a warning to the resource check 2017-04-03 09:43:31 +08:00