Commit Graph

4525 Commits (2f694e8fa1e5b965839c173881d2a406d8c5c030)

Author SHA1 Message Date
Shijiang Wei 2f485ec84b kubectl: fix a panic when createGeneratedObject failed
Reproduce:
kubectl run --image=alpine hello -- sleep 1d
kubectl run --image=alpine --stdin --tty --attach hello -- /bin/sh

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2018-03-28 11:26:00 +08:00
WanLinghao e96794e689 when copy file from host to pod like this:
1.kubectl copy /tmp/test-file test-pod:/
	2.kubectl copy /tmp/test-file test-pod:
	example 1 will fail, example 2 will cause a panic.
	This patch fix bugs above.
2018-03-28 10:37:29 +08:00
Kubernetes Submit Queue 2b03013307
Merge pull request #61692 from CaoShuFeng/output-version
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean up output-version

ref: https://github.com/kubernetes/kubernetes/pull/41576

**Release note**:
```release-note
NONE
```
2018-03-27 09:47:18 -07:00
Kubernetes Submit Queue 13378f4643
Merge pull request #61462 from WanLinghao/kubectl_return_obj_fix
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix print object should be updated error

**What this PR does / why we need it**:
	Print object should be updated.
  After this patch, it goes the same as create.go
0254399884/pkg/kubectl/cmd/create.go (L346)
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-27 09:47:15 -07:00
Stephen Augustus c3a50cd266 Update bazel rules 2018-03-27 09:54:04 -05:00
Stephen Augustus 09aa0b9c1d pkg/util/pointer: Update `int` pointer functions
* Implement `Int64Ptr` function
* Replace per module functions of `int(32|64)?` --> `*int(32|64)?`
* Update bazel rules
2018-03-27 10:30:01 -04:00
Kubernetes Submit Queue 76ffe9e832
Merge pull request #58787 from Lion-Wei/kubectl-3
Automatic merge from submit-queue (batch tested with PRs 60499, 61715, 61688, 61300, 58787). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix kubectl apply error message

**What this PR does / why we need it**:
Fix messy code in kubectl apply error message. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubectl#197

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
/sig cli
2018-03-27 04:08:15 -07:00
Kubernetes Submit Queue d885863793
Merge pull request #60499 from superbrothers/last-applied
Automatic merge from submit-queue (batch tested with PRs 60499, 61715, 61688, 61300, 58787). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support completion for kubectl apply view/edit-last-applied

**What this PR does / why we need it**: With this PR, `kubectl apply view/edit-last-applied` support completion.
```
$ kubectl apply view-last-applied <tab>
certificatesigningrequest  configmap           daemonset   event                    job            node                   pod                  podtemplate            rolebinding  serviceaccount  storageclass
clusterrolebinding         controllerrevision  deployment  horizontalpodautoscaler  namespace      persistentvolume       poddisruptionbudget  replicaset             secret       statefulset     
componentstatus            cronjob             endpoints   ingress                  networkpolicy  persistentvolumeclaim  podsecuritypolicy    replicationcontroller  service      status
$ kubectl apply view-last-applied deployment nginx<tab>
nginx   nginx2
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
`kubectl apply view/edit-last-applied support completion.
```
2018-03-27 04:08:04 -07:00
Cao Shufeng a06f0077bd Support multi-container pod for "kubectl logs"
kubectl logs -l will print logs for pods with the same label, however
it doesn't support pods with multi containers. This change adds support
to it with --all-containers.

Ussage:
$ kubectl logs my-pod --all-containers
$ kubectl logs -laa=bb --all-containers
$ kubectl logs my-pod my-container --all-containers (err: --all-containers=true should not be specifiled with container name my-container)
2018-03-27 11:44:31 +08:00
p0lyn0mial 1f1d24005a removes custom scalers from kubectl 2018-03-26 19:33:42 +02:00
Kubernetes Submit Queue c64494a0cb
Merge pull request #61442 from anfernee/simple-fixes
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix comments and small fixes

**What this PR does / why we need it**: Fix some comments, and remove trivial duplicates. 

**Release note**:
```release-note
None
```
2018-03-26 06:35:41 -07:00
Kubernetes Submit Queue 3a2fe7b8f9
Merge pull request #61523 from dixudx/formatter_escape_percent_sign
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

escape literal percent sign when formatting

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

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

**Special notes for your reviewer**:
/assign @janetkuo @liggitt 
/cc @kubernetes/sig-cli-bugs 

**Release note**:

```release-note
escape literal percent sign when formatting
```
2018-03-26 03:52:16 -07:00
Maciej Szulik 94d8b93239
Turn server-print on by default in kubectl 2018-03-26 12:30:12 +02:00
Cao Shufeng 51224740f5 clean up output-version 2018-03-26 15:40:40 +08:00
Kubernetes Submit Queue fba61b050a
Merge pull request #60675 from timoreimann/support-dry-run-in-kubectl-patch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for --dry-run to kubectl patch.

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

Add support for the `--dry-run` flag to `kubectl patch`. This is helpful to be able to preview patches prior to applying them.

**Which issue(s) this PR fixes**:
Refs #11488

**Special notes for your reviewer**:

This PR carries #45712.

**Release note**:
```release-note
`kubectl patch` now supports `--dry-run`.
```
2018-03-25 12:24:08 -07:00
Kazuki Suda 1989aa5023 Support completion for kubectl apply view/edit-last-applied 2018-03-24 14:42:02 +09:00
fanzhangio 0299a2403f Add conflict detection feature to apply strategy
- Add DetectConflictor interface on Element level. Implemented it for particular elements.
- If Options.FailOnConflict is enabled, Merge will detect conflict by invoking doConflictDecect for particular element,
  returning ConflictError with details.
- Add tests, including use case examples and illustration. For example: list, map, and complicated combination.
2018-03-23 01:56:20 -07:00
Di Xu d0dbd94db0 escape literal percent sign when formatting 2018-03-23 12:59:50 +08:00
zhengjiajin 457a7e76d9 add kubectl config view --raw example help user use 2018-03-23 09:51:47 +08:00
Kubernetes Submit Queue 3798b1f842
Merge pull request #61378 from charrywanganthony/delete_force
Automatic merge from submit-queue (batch tested with PRs 61378, 60915, 61499, 61507, 61478). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

`--force` only takes effect when `--grace-period=0`

`kubectl delete` should warn when `force` is specified without `--grace-period=0`

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


**Release note**:
```release-note
NONE
```
2018-03-22 07:15:15 -07:00
Kubernetes Submit Queue 114d481183
Merge pull request #60793 from charrywanganthony/inert_flag_showall
Automatic merge from submit-queue (batch tested with PRs 60793, 61181, 61267, 61252, 61334). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

--show-all is inert in v1.11

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

`--show-all` is inert in v1.11
ref: #60210

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:

```release-note
`--show-all` (which only affected pods and only for human readable/non-API printers) is inert in v1.11, and will be removed in a future release.
```
2018-03-21 20:23:07 -07:00
Kubernetes Submit Queue 32858f98b3
Merge pull request #60806 from juanvallejo/jvallejo/add-from-literal-from-value-flags
Automatic merge from submit-queue (batch tested with PRs 60632, 60806, 59471, 61251, 61013). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add --from-literal --from-file docker-reg secret

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

Related downstream issue https://github.com/openshift/origin/issues/18833

Adds `--from-file` and `--from-literal` flag support to `kubectl create secret docker-registry`.
These flags have the same behavior as their counterparts in `kubectl create secret generic`.

cc @bparees @soltysh
2018-03-21 16:01:11 -07:00
Kubernetes Submit Queue b8433123b2
Merge pull request #61219 from WanLinghao/description_fix
Automatic merge from submit-queue (batch tested with PRs 61487, 58353, 61078, 61219, 60792). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix a small error in description

**What this PR does / why we need it**:
The example in create job subcommand lacks job-name, this patch fixes this
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-21 14:15:17 -07:00
Kubernetes Submit Queue 5286806a52
Merge pull request #58353 from juanvallejo/jvallejo/usability-fix-label
Automatic merge from submit-queue (batch tested with PRs 61487, 58353, 61078, 61219, 60792). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

distinguish which labels belong to resource

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

Usability improvement for `kubectl label ... --list` when listing labels for more than one resource.
Append resource kind/name before its set of labels.

**Before**
```
$ kubectl label dc myapp test-deployment-config label1=test --list
app=myapp
label1=test
label1=test
```

**After**
```
$ kubectl label dc myapp test-deployment-config label1=test --list
Listing labels for DeploymentConfig/myapp:
  label1=test
  app=myapp
Listing labels for DeploymentConfig/test-deployment-config:
  label1=test
```
2018-03-21 14:15:10 -07:00
Kubernetes Submit Queue e40ffd7197
Merge pull request #59172 from fisherxu/removeyear
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove YEAR field of all generated files and fix kubernetes boilerplate checker

**What this PR does / why we need it**:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: [remove YEAR fileds in gengo #91](https://github.com/kubernetes/gengo/pull/91)

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

**Special notes for your reviewer**:
/cc @thockin @lavalamp @sttts 

**Release note**:

```release-note
NONE
```
2018-03-21 12:44:37 -07:00
Timo Reimann b9c1fc6f3c Support --dry-run in kubectl patch command. 2018-03-21 19:06:44 +01:00
juanvallejo ae51a45d70
add --from-file flag to docker-registry secret 2018-03-21 11:13:11 -04:00
Kubernetes Submit Queue 808545a8aa
Merge pull request #60602 from bendrucker/docker-registry-email-optional
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove docker-email from required args for "create secret docker-registry"

Completes https://github.com/kubernetes/kubernetes/pull/42191

While that removed `docker-email` as required from the generator, the CLI still asserts the presence of the argument resulting in "error: flag docker-email is required" when `--docker-email` is omitted from a `kubectl create secret docker-registry` call.

Comments on the original issue (https://github.com/kubernetes/kubernetes/issues/41727) note that this change is still needed to accomplish the original intent.
2018-03-21 07:34:21 -07:00
Kubernetes Submit Queue 3b04de4be3
Merge pull request #60826 from WanLinghao/job_dry_run
Automatic merge from submit-queue (batch tested with PRs 61087, 61075, 61213, 61149, 60826). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for --dry-run to kubectl create job

**What this PR does / why we need it**:
Create job subcommand lacks dry-run flag, this patch fix this.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-21 06:41:38 -07:00
Chao Wang 4e6a430bce `--force` only takes effect when `--grace-period=0` 2018-03-21 16:28:52 +08:00
WanLinghao 83a148310d Print object should be updated which may cause potential bug.
This patch fix this.
	modified:   pkg/kubectl/cmd/create_clusterrole.go
	modified:   pkg/kubectl/cmd/create_role.go
2018-03-21 15:34:50 +08:00
Kubernetes Submit Queue 23844fe0f4
Merge pull request #57871 from CaoShuFeng/delete_test
Automatic merge from submit-queue (batch tested with PRs 57871, 61094, 60459, 61089, 61105). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove invalid comments in unit tests

**Release note**:

```release-note
NONE
```
2018-03-20 23:34:30 -07:00
WanLinghao a3424872bd this patch do tow things:
1.add dry-run flag for create job subcommand
	2.add cmd-util test for create job subcommand
	modified:   pkg/kubectl/cmd/create_job.go
	modified:   hack/make-rules/test-cmd-util.sh
2018-03-21 10:41:17 +08:00
Kubernetes Submit Queue 3e5596321e
Merge pull request #60919 from dixudx/file_visit_error_info
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

include file name in the error when visiting files

**What this PR does / why we need it**:
/kind bug
/sig cli

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

**Special notes for your reviewer**:
/cc @kubernetes/sig-cli-api-reviews 
**Release note**:

```release-note
include file name in the error when visiting files
```
2018-03-20 19:34:23 -07:00
Kubernetes Submit Queue 4159be8a5a
Merge pull request #60360 from dixudx/kubectl_apply_flag_value_bind
Automatic merge from submit-queue (batch tested with PRs 61003, 61031, 60360, 58349, 60922). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

flag value bindings for kubectl apply commands

**What this PR does / why we need it**:
/kind cleanup
/sig cli

xxxOptions did not get bound as default value for some flags.
This PR cleans those flag bindings for `kubectl apply` commands.

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

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:

```release-note
None
```
2018-03-20 18:34:32 -07:00
Kubernetes Submit Queue 16081cca2b
Merge pull request #61031 from zjj2wry/kubectl_create_role
Automatic merge from submit-queue (batch tested with PRs 61003, 61031, 60360, 58349, 60922). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

resource-name not present in the URL for list,watch,deletecollection

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

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

**Special notes for your reviewer**:
cc @deads2k @liggitt 
/sig cli
/sig auth

**Release note**:

```release-note
NONE
```
2018-03-20 18:34:29 -07:00
Chao Wang 71a1970bf6 --show-all is inert in v1.11 2018-03-21 09:13:21 +08:00
Yongkun Anfernee Gui 0ce78700ae Fix comments and some small fixes 2018-03-20 15:59:23 -07:00
Kubernetes Submit Queue e8388e035b
Merge pull request #60357 from dixudx/kubectl_a2e_flags_bind
Automatic merge from submit-queue (batch tested with PRs 60574, 60666, 60831, 60877, 60357). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

flag value bindings for kubectl attach/convert/delete/drain/edit/exec commands

**What this PR does / why we need it**:
xxxOptions did not get bound as default value for flags.
This PR cleans those flag bindings for `kubectl  attach/convert/delete/drain/edit/exec` commands.

/kind cleanup

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

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:

```release-note
None
```
2018-03-20 08:34:47 -07:00
Kubernetes Submit Queue 3d726a28bd
Merge pull request #60363 from dixudx/kubectl_set_create_flags_bind
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

flag value bindings for kubectl create/get/set commands

**What this PR does / why we need it**:
/kind cleanup
/sig cli

xxxOptions did not get bound as default value for some flags.
This PR cleans those flag bindings for `create/get/set` commands.

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

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:

```release-note
None
```
2018-03-20 02:34:22 -07:00
Kubernetes Submit Queue a41483a8f5
Merge pull request #60353 from WanLinghao/printer_clean
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean testprinter

**What this PR does / why we need it**:
testPrinter became useless after patch #60117 
This patch clean it 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 00:42:20 -07:00
Kubernetes Submit Queue 8962c78577
Merge pull request #60621 from WanLinghao/kubectl_flags_bind_miss
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

supplement for the fix of kubectl default value binding

**What this PR does / why we need it**:
Issue https://github.com/kubernetes/kubernetes/issues/60366
lists a bunch of PRs that fix kubectl default value binding problems.
This patch supplement a missed file.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60366

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 00:42:15 -07:00
Kubernetes Submit Queue b43f18d43b
Merge pull request #61204 from janetkuo/ep-doc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Document that endpoints is only plural in resource aliases

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-19 20:34:53 -07:00
hangaoshuai c26293b848 fix failed verify misspell err 2018-03-20 11:16:51 +08:00
Lion-Wei e2dedc76a8 fix kubectl apply error message 2018-03-17 15:08:26 +08:00
Brendan Burns d196afabc4 Fix a bug where malformed paths don't get written to the destination dir. 2018-03-16 12:19:31 -07:00
hangaoshuai 3fe980f8ed add unit test for func parsePorts and validate 2018-03-16 09:54:52 +08:00
WanLinghao 8653c5ece2 fix a small error in description
modified:   pkg/kubectl/cmd/create_job.go
2018-03-15 16:51:15 +08:00
Janet Kuo b5b76d8187 Document that endpoints is only plural in resource aliases 2018-03-14 16:02:51 -07:00
Davanum Srinivas 4cbdbae6e0 Add missing binaryData field to the ConfigMap Hash
In 7e158fb4f6, we added a BinaryData
to ConfigMap, but totally forgot to add it to the hash method.
2018-03-13 22:08:06 -04:00
juanvallejo 3dc952e761
fix kubectl_filedir completion 2018-03-13 16:21:30 -04:00
juanvallejo d1cb6e36f2
distinguish which labels belong to resource 2018-03-12 11:10:27 -04:00
zhengjiajin 17c9d1fa14 resource-name not present in the URL for list,watch,deletecollection 2018-03-12 16:29:18 +08:00
WanLinghao aec1240ca7 fix show-all option description
modified:   pkg/kubectl/cmd/util/printing.go
2018-03-12 10:34:08 +08:00
Bruno Miguel Custodio 6889dc82ef
Ensure reasons end up as comments in kubectl edit.
Signed-off-by: Bruno Miguel Custodio <brunomcustodio@gmail.com>
2018-03-10 13:08:50 +00:00
Cao Shufeng edce292a1f Remove invalid comments in unit tests 2018-03-10 15:08:12 +08:00
Kubernetes Submit Queue df36379670
Merge pull request #60950 from juanvallejo/jvallejo/use-temp-kubeconfig-file-tests
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use temp kubeconfig for fake factory

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

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

cc @deads2k @ixdy
2018-03-09 15:00:21 -08:00
juanvallejo 8d35f94d51
use temp kubeconfig for fake factory 2018-03-09 15:53:19 -05:00
juanvallejo 177dcb998f
match KindFor first 2018-03-09 15:43:10 -05:00
xilabao 110641b34c add kubectl api-resources command 2018-03-09 17:47:17 +08:00
Di Xu a08cb5b531 include file name in the error when visiting files 2018-03-09 10:19:20 +08:00
fisherxu b49ef6531c regenerated all files and remove all YEAR fields 2018-03-08 17:52:48 +08:00
Di Xu 9555debc82 flag value bindings for kubectl apply commands 2018-03-08 10:32:59 +08:00
Kubernetes Submit Queue 3511f708cb
Merge pull request #60630 from CaoShuFeng/scale_job
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove "scale job" from help info

Remove "scale job" from help info since it's deprecated



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @deads2k @soltysh
2018-03-06 07:35:44 -08:00
Kubernetes Submit Queue 6608a47c84
Merge pull request #60572 from charrywanganthony/show-all_descr
Automatic merge from submit-queue (batch tested with PRs 60362, 60629, 60572). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

improve get description

ref: #60210

/assign @deads2k 

**Release note**:

```release-note
NONE
```
2018-03-01 07:42:54 -08:00
Cao Shufeng 8be9d275b6 remove "scale job" from help info
Remove "scale job" from help info since it's deprecated
2018-03-01 17:00:05 +08:00
Cao Shufeng f0cd1ad04e fix warning info format
Before this change:
```
$ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls
-p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.bin
boot
dev
...

$ kubectl scale --replicas=2 job/pi
kubectl scale job is DEPRECATED and will be removed in a future version.job.batch "pi" scaled
```

After this change:
```
$ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls
-p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.
bin
boot
dev
...

$ kubectl scale --replicas=2 job/pi
kubectl scale job is DEPRECATED and will be removed in a future version.
job.batch "pi" scaled
```
2018-03-01 16:39:31 +08:00
WanLinghao 7489189c2a supplement for the fix of issue:
https://github.com/kubernetes/kubernetes/issues/60366

	modified:   pkg/kubectl/cmd/describe.go
2018-03-01 16:10:04 +08:00
Chao Wang d6328da987 improve get description 2018-03-01 09:16:24 +08:00
Ben Drucker aa139f1654 remove docker-email from required args for "create secret docker-registry" 2018-02-28 17:03:35 -08:00
Kubernetes Submit Queue 98eb5cbd04
Merge pull request #56075 from shyamjvs/move-rc-scaling-to-polling
Automatic merge from submit-queue (batch tested with PRs 60470, 59149, 56075, 60280, 60504). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make Scale() for RC poll-based until #31345 is fixed

Fixes https://github.com/kubernetes/kubernetes/issues/56064
,in the short-term until issue #31345 is fixed.
We should eventually move RS, job, deployment, etc all to watch-based (https://github.com/kubernetes/kubernetes/issues/56071)

/cc @wojtek-t - SGTY?

```release-note
NONE
```
2018-02-28 04:54:32 -08:00
Di Xu abb602b279 flag value bindings for kubectl attach/convert/delete/drain/edit/exec commands 2018-02-28 15:21:39 +08:00
Kubernetes Submit Queue d9da83a022
Merge pull request #60355 from CaoShuFeng/cli_example
Automatic merge from submit-queue (batch tested with PRs 60430, 60115, 58052, 60355, 60116). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix cli example

ref: https://github.com/kubernetes/kubernetes/pull/60210

/assign @deads2k 

**Release note**:

```release-note
NONE
```
2018-02-27 09:38:47 -08:00
Shyam Jeedigunta fd2ea3ff31 Make Scale() for RC poll-based until #31345 is fixed 2018-02-27 13:10:38 +01:00
Kubernetes Submit Queue 1eb1c00c44
Merge pull request #59674 from jennybuckley/codegen
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

code-gen: output golint compliant 'Generated by' comment

New PR instead of reopening #58115 because /reopen did not work.
This won't be ready to merge until the upstream https://github.com/kubernetes/gengo/pull/94 merges. Once that merges, the second commit will be changed to godep-save.sh and update-staging-godeps.sh, and the last commit will be changed to update-all.sh

The failing test is due to the upstream changes not being merged yet

```devel-release-note
Go code generated by the code generators will now have a comment which allows them to be easily identified by golint
```

Fixes #56489
2018-02-27 02:47:05 -08:00
Kubernetes Submit Queue 56ce616e5b
Merge pull request #60364 from dixudx/kubectl_common_flags_bind
Automatic merge from submit-queue (batch tested with PRs 60427, 60361, 60364, 58625, 60187). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: flag value bindings for common utils

**What this PR does / why we need it**:
/kind cleanup
/sig cli

xxxOptions did not get bound as default value for some flags.
This PR cleans those flag bindings in common utils library.

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

**Special notes for your reviewer**:
/assign @deads2k 
**Release note**:

```release-note
None
```
2018-02-27 01:34:26 -08:00
Kubernetes Submit Queue 38b61e2914
Merge pull request #60361 from dixudx/kubectl_l2v_flags_bind
Automatic merge from submit-queue (batch tested with PRs 60427, 60361, 60364, 58625, 60187). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

flag value bindings for kubectl label/patch/taint/top commands

**What this PR does / why we need it**:
/kind cleanup
/sig cli

xxxOptions did not get bound as default value for some flags.
This PR cleans those flag bindings for `kubectl label/patch/taint/top` commands.

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

**Special notes for your reviewer**:
/assign @deads2k
**Release note**:

```release-note
None
```
2018-02-27 01:34:22 -08:00
Di Xu 33b3fb9bed flag value bindings for kubectl create/get/set commands 2018-02-27 11:00:55 +08:00
jennybuckley c8dacd8e63 Run hack/update-all.sh 2018-02-26 17:16:14 -08:00
Manuel de Brito Fontes 02370e529b
Remove cassandra example 2018-02-26 20:39:07 -03:00
David Hao b112d19b70 Do not log unchanged message if a format other than 'name' is specified 2018-02-26 18:34:40 -05:00
David Eads f9a884d3f5 adjust filtered object test to reflect old weird behavior 2018-02-26 08:08:47 -05:00
David Eads a1b7785e2e Revert "fix resource filter for generic printers on get"
This reverts commit 799a0bf410.
2018-02-26 08:05:05 -05:00
Di Xu d1725fc683 kubectl: flag value bindings for common utils 2018-02-24 17:31:02 +08:00
Di Xu cda7f95d46 flag value bindings for kubectl label/patch/taint/top commands 2018-02-24 16:37:19 +08:00
Cao Shufeng 085e8bf6c4 fix cli example 2018-02-24 14:52:49 +08:00
WanLinghao 6eee5dd421 clean testprinter after commit:
https://github.com/kubernetes/kubernetes/pull/60117

	modified:   pkg/kubectl/cmd/cmd_test.go
	modified:   pkg/kubectl/cmd/resource/get_test.go
2018-02-24 13:41:42 +08:00
Kubernetes Submit Queue e833d6880e
Merge pull request #59883 from kow3ns/ds-cntrl-v1
Automatic merge from submit-queue (batch tested with PRs 59286, 59743, 59883, 60190, 60165). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

DaemonSet Controller and tests to apps/v1

**What this PR does / why we need it**:
Updates the DaemonSet controller, its integration tests, and its e2e tests to use the apps/v1 API.

**Release note**:
```release-note
The DaemonSet controller, its integration tests, and its e2e tests, have been updated to use the apps/v1 API.
```
2018-02-23 20:09:35 -08:00
Kubernetes Submit Queue f7c65005a4
Merge pull request #59042 from soltysh/issue25442
Automatic merge from submit-queue (batch tested with PRs 60302, 57921, 59042, 60126, 59561). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove pkg/client/unversioned

**What this PR does / why we need it**:
This is removing unused package, and moves the used bits into appropriate placeholders. 

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

**Special notes for your reviewer**:

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

/assign @deads2k 
/assign @sttts
2018-02-23 14:01:44 -08:00
David Eads a0cb7a7940 Revert "Allow env to be updated via specific key in resource"
This reverts commit 905a0698fa.
2018-02-23 13:31:42 -05:00
Kubernetes Submit Queue 890bd2174c
Merge pull request #60210 from deads2k/cli-12-showall
Automatic merge from submit-queue (batch tested with PRs 55637, 57461, 60268, 60290, 60210). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

deprecate --show-all

`--show-all` is a pod-only filter that only affects human-readable printing of pods and only from `kubectl get`.  It hides pods which are in a terminal state.  Even at the beginning this was questionable, since you often (usually?) want to see the pods that have failed: all happy pods are alike, but every unhappy pod is unhappy in its own way.  In addition, it only worked on human-readable printers.  Doing a `-o name` or `-o yaml` showed a different set of results!

Per the mailing list discussion here: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/0SxgDxObxD0

```release-note
`--show-all` (which only affected pods and only for human readable/non-API printers) is now defaulted to true and deprecated.  It will be inert in 1.11 and removed in a future release.
```

/assign @adohe 
/assign @pwittrock 
/assign @soltysh 

@kubernetes/sig-cli-maintainers
2018-02-23 09:49:48 -08:00
Kenneth Owens f89afa008f Update versioned portions of kubectl to use apps/v1 with DaemonSet 2018-02-23 08:06:42 -08:00
juanvallejo 9946374f82
handle Table response in client
This patch adds support for the "server-side GET operation"
introduced by pull/40848 and proposed by kubernetes/community#363.
2018-02-23 10:41:04 -05:00
David Eads 6047ead2e5 simplify kubectl testing factory 2018-02-23 08:02:53 -05:00
Kubernetes Submit Queue d4acd6b997
Merge pull request #58283 from nikhita/kubectl-scale-unstructured
Automatic merge from submit-queue (batch tested with PRs 59463, 59719, 60181, 58283, 59966). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl scale: support Unstructured objects

Support `Unstructured` objects with kubectl scale.

So that we can use the scale subresource for custom resources (possible after https://github.com/kubernetes/kubernetes/pull/55168 is merged):

```
➜ cluster/kubectl.sh scale --replicas=5 crontabs/my-new-cron-object
crontab "my-new-cron-object" scaled
```

**Release note**:

```release-note
NONE
```

/cc sttts deads2k p0lyn0mial
2018-02-23 00:34:30 -08:00
Kubernetes Submit Queue 32fbec0ca4
Merge pull request #60084 from soltysh/create_job
Automatic merge from submit-queue (batch tested with PRs 60208, 60084, 60183, 59713, 60096). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl create job

**What this PR does / why we need it**:
This add `kubectl create job` command, and is a followup to #60039. 

**Special notes for your reviewer**:

**Release note**:
```release-note
Add kubectl create job command
```
2018-02-22 23:17:32 -08:00
Kubernetes Submit Queue 4f083dee54
Merge pull request #60208 from soltysh/remove_factory_metricsclient_method
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove factory metricsclient method

**What this PR does / why we need it**:
Alternative approach to https://github.com/kubernetes/kubernetes/pull/60142 which fixed the `NewCmdTopPod` return arguments

/assign @deads2k 

**Release note**:
```release-note
None
```
2018-02-22 22:45:58 -08:00
Kubernetes Submit Queue bd5b46a4f2
Merge pull request #60204 from soltysh/remove_factory_client_methods
Automatic merge from submit-queue (batch tested with PRs 60214, 58762, 59898, 59897, 60204). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove ClientSetForVersion & ClientConfigForVersion from factory

**What this PR does / why we need it**:
This is further cleaning the factory.

**Special notes for your reviewer**:
/assign @deads2k 

**Release note**:
```release-note
NONE
```
2018-02-22 22:02:43 -08:00
Maciej Szulik 999273fbd7
Remove ClientSetForVersion & ClientConfigForVersion from factory 2018-02-22 15:50:27 +01:00
Kubernetes Submit Queue c85ede510b
Merge pull request #60040 from PhilipGough/keys-from-cm
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow env to be updated via specific key in resource

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

This change allows users of the `oc` client to specify a list of comma-separated keys when running `oc set env` which should be imported from a resource i.e configmap or secret

This can be useful when a number of applications want to share a configuration object but don't want to pollute a resource with unused environment 



**Release note**:

```release-note
Allow kubectl env to specify which keys to import from a config map
```
2018-02-22 06:08:55 -08:00
Maciej Szulik 4d7d153a12
Remove unnecessary return parameter from NewCmdTopPod 2018-02-22 14:33:14 +01:00
Maciej Szulik 8bf4cfcf60
Add kubectl create job --from=cronjob/<name> 2018-02-22 14:30:37 +01:00
Edmund Rhudy 5b57c2db00
Fixes #47538: Add functionality for manually creating a Job instance from a CronJob
This changeset adds the command `kubectl create job` with the flag `--from-cronjob`, which allows a user to create a Job from a CronJob via the CLI.
2018-02-22 14:30:37 +01:00
David Eads c9cb705816 deprecate --show-all 2018-02-22 08:19:12 -05:00
David Eads f084311326 remove metrics client factory method 2018-02-22 07:45:04 -05:00
PhilipGough 905a0698fa
Allow env to be updated via specific key in resource 2018-02-22 11:00:55 +00:00
Kubernetes Submit Queue 39c7e9242b
Merge pull request #60139 from soltysh/deprecate_scale_job
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate kubectl scale job

**What this PR does / why we need it**:
With the generic scaler (https://github.com/kubernetes/kubernetes/pull/58298) the only problem is job and as discussed in https://github.com/kubernetes/kubernetes/pull/58468#issuecomment-360794229 and during SIG CLI we've agreed that scaling jobs was a mistake we need to revert. 
This PR deprecates scale command for jobs, only. 

/assign @deads2k @pwittrock 

**Release note**:
```release-note
Deprecate kubectl scale jobs (only jobs). 
```
2018-02-22 01:29:30 -08:00
Kubernetes Submit Queue 7d64d30177
Merge pull request #60094 from juanvallejo/jvallejo/remove-printobjectspecificmessage
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove f.PrintObjectSpecificMessage

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

Mailing list discussion: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/gZWg8Ulo3Ao

Removes the `PrintObjectSpecificMessage` helper in an effort to reduce printing stack complexity, and avoid special-casing resources.
2018-02-22 00:35:21 -08:00
Kubernetes Submit Queue f331434774
Merge pull request #60154 from deads2k/cli-11-decoder
Automatic merge from submit-queue (batch tested with PRs 60148, 60022, 59125, 60068, 60154). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 remove unneeded factory codec methods

Builds on https://github.com/kubernetes/kubernetes/pull/60117, so only the last commit is unique.

After we collapsed onto our own internal scheme for managing conversion and typing, the flexibility in codecs is the next area to collapse.  This pull eliminates those methods from the factory and then removes lots of dead code in the fake factories that supported this un-used flexibility

@kubernetes/sig-cli-maintainers 
@pwittrock @adohe @soltysh looking cleaner all the time.

```release-note
NONE
```
2018-02-21 18:09:51 -08:00
juanvallejo e3d81517ae remove f.PrintObjectSpecificMessage 2018-02-21 21:06:49 -05:00
Kubernetes Submit Queue b114a117f8
Merge pull request #60117 from deads2k/cli-08-printer-round2
Automatic merge from submit-queue (batch tested with PRs 58716, 59977, 59316, 59884, 60117). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

collapse printing paths

This collapses our printers into:

1. `PrintSuccess` - which was special cased before and should really just be a flavor of printer
2. `PrintObject` - prints an object using all the defaults.  This should go away once we have options on all our commands.
3. `PrinterForOptions` - which gives back a printer based on the options.  This should really be a method on the options themselves.

And none of these methods have any factory dependencies anymore.

@kubernetes/sig-cli-maintainers 
@soltysh @juanvallejo  You two have followed the work.  Let's tie this off.

```release-note
NONE
```
2018-02-21 15:40:48 -08:00
Maciej Szulik 2935fd69e9
Change printDeprecationWarning to use fmt.Fprintf instead of glog 2018-02-21 22:38:39 +01:00
Maciej Szulik 0bf2561898
Deprecate kubectl scale job 2018-02-21 22:31:15 +01:00
David Eads d8a5420b7c remove unneeded factory codec methods 2018-02-21 15:20:20 -05:00
Kubernetes Submit Queue 2b530438f1
Merge pull request #57087 from luksa/trailing_commas_test_swagger_json
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove trailing commas from test-swagger.json

Trailing commas are not allowed in JSON. Commas are only allowed between values. See http://www.json.org/

**What this PR does / why we need it**:
Fixes invalid JSON in test-swagger.json

**Release note**:
```release-note
NONE
```
2018-02-21 09:51:26 -08:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
Maciej Szulik 5d721bff81
Remove pkg/client/unversioned 2018-02-21 13:08:11 +01:00
David Eads 799a0bf410 fix resource filter for generic printers on get 2018-02-20 22:10:44 -05:00
Kubernetes Submit Queue 370540f90d
Merge pull request #60057 from deads2k/cli-07-printer
Automatic merge from submit-queue (batch tested with PRs 59391, 58097, 60057, 60090). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup printers some more

This cleans up some more dead printer flags and unnecessary arguments for various methods.  We're getting closer.  Still need to clean up some ugly around `PrintSuccess` and then its time to start trimming layers.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-02-20 13:51:35 -08:00
David Eads dd6405681f cleanup printers some more 2018-02-20 12:59:40 -05:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Kubernetes Submit Queue 01ec7a9eb8
Merge pull request #59809 from phsiao/59733_port_forward_with_target_port
Automatic merge from submit-queue (batch tested with PRs 59809, 59955). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl port-forward should resolve service port to target port

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

Continues on the work in #59705, this PR adds additional support for looking up targetPort for a service, as well as enable using svc/name to select a pod.

**Which issue(s) this PR fixes**:
Fixes #15180
Fixes #59733

**Special notes for your reviewer**:

I decided to create pkg/kubectl/util/service_port.go to contain two functions that might be re-usable.

**Release note**:
```release-note
`kubectl port-forward` now supports specifying a service to port forward to: `kubectl port-forward svc/myservice 8443:443`
```
2018-02-15 22:42:30 -08:00
Kubernetes Submit Queue bb500a73b6
Merge pull request #59353 from juanvallejo/jvallejo/update-name-printer-output
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update name printer output to kind.group/name

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

Followup to https://github.com/kubernetes/kubernetes/pull/59227

Updates output via `-o name` to be pipeable.

cc @deads2k
2018-02-15 10:37:19 -08:00
juanvallejo 765f9ec68b
update -o name format to kind.group/name 2018-02-15 10:33:06 -05:00
Shawn Hsiao 4a0bbf2363 kubectl port-forward support resolving service port to target port, and support Service as resource type 2018-02-14 12:02:57 -05:00
Shawn Hsiao 139c62c3e9 kubectl port-forward allows using resource name to select a matching pod 2018-02-13 12:10:02 -05:00
Kubernetes Submit Queue 198a098d9d
Merge pull request #59506 from juanvallejo/jvallejo/handle-watch-multiple-reqs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix --watch on multiple requests

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

`kubectl get <resource> --watch` only supports watching a single resource kind at a time.
This check fails if more than one resource `Info` is returned.

When dealing with large quantities of a single resource kind, or an amount that exceeds the value of `--chunk-size`, more than one request is made to the server causing a resource `Info` to be created for each of the requests, ultimately causing the above check to fail even though we are dealing with the same type of resource.

This patch modifies that check to take into account the GVKs of all infos returned, and only fail if at least one differs.

cc @deads2k
2018-02-12 02:25:45 -08:00
Kubernetes Submit Queue 317853c90c
Merge pull request #59464 from dixudx/fix_all_typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix all the typos across the project

**What this PR does / why we need it**:
There are lots of typos across the project. We should avoid small PRs on fixing those annoying typos, which is time-consuming and low efficient.

This PR does fix all the typos across the project currently. And with #59463, typos could be avoided when a new PR gets merged.

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

**Special notes for your reviewer**:
/sig testing
/area test-infra
/sig release
/cc @ixdy 
/assign @fejta 

**Release note**:

```release-note
None
```
2018-02-10 22:12:45 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Kubernetes Submit Queue dd71bf035f
Merge pull request #51339 from zjj2wry/kubectl-run
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add more error logs in kubectl run

**What this PR does / why we need it**:
closes issue #29307 
now will get log with different cases:
```bash
kubectl run hello-node --image=aronchick/hello-node:2.0 --port=8080 --expose=true
service "hello-node" created
deployment "hello-node" created
kubectl run hello-node --image=aronchick/hello-node:2.0 --port=8080 --expose=true
Error from server (AlreadyExists): deployments.extensions "hello-node" already exists
Error from server (AlreadyExists): services "hello-node" already exists
kubectl delete deploy hello-node
deployment "hello-node" deleted
kubectl run hello-node --image=aronchick/hello-node:2.0 --port=8080 --expose=true
deployment "hello-node" created
Error from server (AlreadyExists): services "hello-node" already exists
kubectl delete svc hello-node
service "hello-node" deleted
kubectl run hello-node --image=aronchick/hello-node:2.0 --port=8080 --expose=true
service "hello-node" created
Error from server (AlreadyExists): deployments.extensions "hello-node" already exists
```

**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
```
2018-02-10 13:27:02 -08:00
juanvallejo aea8deee03
fix --watch on multiple requests 2018-02-09 15:17:02 -05:00
Fan Zhang bfa3029c8e Cleanup and add category doc
- Clean up some useless or vague comments. Fixed typos
- Add illustration for CategoryExpender and implements structs
2018-02-08 10:47:05 -08:00
zhengjiajin 6dfe3cb04f add more error logs in kubectl run 2018-02-08 19:37:47 +08:00
Kubernetes Submit Queue fb340a4695
Merge pull request #57824 from thockin/gcr-vanity
Automatic merge from submit-queue (batch tested with PRs 57824, 58806, 59410, 59280). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

2nd try at using a vanity GCR name

The 2nd commit here is the changes relative to the reverted PR.  Please focus review attention on that.

This is the 2nd attempt.  The previous try (#57573) was reverted while we
figured out the regional mirrors (oops).
    
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
    
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
    
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.

xref https://github.com/kubernetes/release/issues/281

TL;DR:
  *  The new `staging-k8s.gcr.io` is where we push images.  It is literally an alias to `gcr.io/google_containers` (the existing repo) and is hosted in the US.
  * The contents of `staging-k8s.gcr.io` are automatically synced to `{asia,eu,us)-k8s.gcr.io`.
  * The new `k8s.gcr.io` will be a read-only alias to whichever regional repo is closest to you.
  * In the future, images will be promoted from `staging` to regional "prod" more explicitly and auditably.

 ```release-note
Use "k8s.gcr.io" for pulling container images rather than "gcr.io/google_containers".  Images are already synced, so this should not impact anyone materially.
    
Documentation and tools should all convert to the new name. Users should take note of this in case they see this new name in the system.
```
2018-02-08 03:29:32 -08:00
Tim Hockin 3586986416 Switch to k8s.gcr.io vanity domain
This is the 2nd attempt.  The previous was reverted while we figured out
the regional mirrors (oops).

New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).

When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.

We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.
2018-02-07 21:14:19 -08:00
Kubernetes Submit Queue 1f6251444b
Merge pull request #51042 from soltysh/request_timeout
Automatic merge from submit-queue (batch tested with PRs 59276, 51042, 58973, 59377, 59472). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow passing request-timeout from NewRequest all the way down

**What this PR does / why we need it**:
Currently if you pass `--request-timeout` it's not passed all the way down to the actual request object. There's a separate field on the `Request` object that allows setting that timeout, but it's not taken from that flag. 

@smarterclayton @deads2k ptal, this is coming from https://github.com/openshift/origin/pull/13701
2018-02-07 12:00:44 -08:00
Kubernetes Submit Queue 15dbd4e2ae
Merge pull request #59227 from juanvallejo/jvallejo/remove-mapper-dep-printer
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove mapper dependency for cmdutil.Factory#PrintSuccess

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

Part of a series of patches removing printing stack dependency on mappings the rest mapper

**Before**
```
$ kubectl label pod/my-pod label=label
pod "my-pod" labeled
```

**After**
```
$ kubectl label pod/my-pod label=label
pods "my-pod" labeled
```

cc @deads2k
2018-02-07 08:39:15 -08:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05:00
Maciej Szulik 7da1002091 Allow passing request-timeout from NewRequest all the way down to actual request 2018-02-07 16:02:26 +01:00
bin liu f679fc1827 Remove duplicated comment 2018-02-07 16:48:22 +08:00
Kubernetes Submit Queue 313f443015
Merge pull request #58991 from juanvallejo/jvallejo/fix-apply-force
Automatic merge from submit-queue (batch tested with PRs 51323, 59306, 58991, 59050). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix apply --force w/ invalid resource

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

- First commit: Fixes cases where `--force` is provided with `kubectl apply`, with an object that is BOTH invalid and will cause a conflict error
- Second commit: Fixes cases where `--force` is provided with `kubectl apply`, with an invalid object 

Justification for the first commit here: https://bugzilla.redhat.com/show_bug.cgi?id=1539529#c3

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

cc @ironcladlou
2018-02-06 10:40:37 -08:00
Kubernetes Submit Queue 989e4f868b
Merge pull request #51323 from dixudx/conflict_flags
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl should return an error if "-l" and "--all" are both specified

**What this PR does / why we need it**:
Per discussion in [#50497](https://github.com/kubernetes/kubernetes/pull/50497#discussion_r134881507)

**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**:
/assign @caesarxuchao @mengqiy 

**Release note**:

```release-note
kubectl should return an error if "-l" and "--all" are both specified
```
2018-02-06 10:00:47 -08:00
juanvallejo ef0e40d39c
fix apply --force w/ invalid AND conflicting resource 2018-02-06 11:29:00 -05:00
Di Xu e45117856e kubectl: cannot set --all and --selector at the same time 2018-02-06 23:55:36 +08:00
Kubernetes Submit Queue 3021aa224c
Merge pull request #55516 from zjj2wry/config-unset
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add example for kubectl config unset, this will help user use

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-05 12:40:40 -08:00
Kubernetes Submit Queue 5320cdeedd
Merge pull request #58533 from juanvallejo/jvallejo/usability-add-kubectl-describe-suggestion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

suggest using describe cmd to list pod containers

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

Usability: suggest using `kubectl describe` to obtain available pod containers when running `kubectl attach ...`

cc @soltysh
2018-02-05 07:27:43 -08:00
zhengjiajin 46f760e8d0 add example for kubectl config unset, this will help user use 2018-02-05 20:33:49 +08:00
juanvallejo 6a79239944
suggest using describe cmd to list pod containers 2018-02-01 15:33:51 -05:00
Juan Vallejo 4026356b1c
Revert "fail earlier on discovery failures" 2018-02-01 13:02:10 -05:00
Kubernetes Submit Queue 8e666feac2
Merge pull request #57322 from niuzhenguo/dry-run-flag-cleanup
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetDryRunFlag to keep consistent

**What this PR does / why we need it**:
There's a cmd util GetDryRunFlag, but we still get 'dry-run' directly somewhere. This PR makes them consistent.

**Release note**:

```release-note
NONE
```
2018-01-29 20:04:54 -08:00
Kubernetes Submit Queue 235714e7f3
Merge pull request #58298 from p0lyn0mial/generic_scaler_scalerfor_continued
Automatic merge from submit-queue (batch tested with PRs 58955, 58968, 58971, 58963, 58298). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

removes the remainder from ScalerFor method

**What this PR does / why we need it**:
this PR removes existing scalers from `ScalerFor` method

**Release note**:

```release-note
NONE
```
2018-01-29 13:48:51 -08:00
p0lyn0mial 71eb1ff3b1 removes the remainder from ScalerFor method
all remaining scalers were replaced by GenericScaler exept JobScaler.
It is not clear whether JobScaler could use generic scaler or not.
For more details see the pull request.
2018-01-29 20:02:27 +01:00
Kubernetes Submit Queue f2ac9671f0
Merge pull request #57229 from niuzhenguo/cleanup_validargs
Automatic merge from submit-queue (batch tested with PRs 57229, 58907). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Abstract cmd valid args get behind the factory

**What this PR does / why we need it**:
This abstract retrieving the list of handled resources for valid args as a function to follow more conventions.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-27 00:31:30 -08:00
Kubernetes Submit Queue 3009ec94f7
Merge pull request #58861 from liggitt/prefer-resources-to-shortnames
Automatic merge from submit-queue (batch tested with PRs 58760, 58861). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Prefer exact resource name matches to shortname expansions

Prevents a shortname of "pod" or "pods" from taking precedence over an exact resource name match

```release-note
NONE
```
2018-01-26 14:46:29 -08:00
Kubernetes Submit Queue c338209e4f
Merge pull request #57500 from niuzhenguo/unique-resource-mappings
Automatic merge from submit-queue (batch tested with PRs 57500, 58840, 58883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make REST mappings for resources a unique list

This ensures the mappings list for resources(shortcuts, plural) unique,
instead of doing multiple requests to server for the same resource.



**What this PR does / why we need it**:
Treat resource shortcuts, plurals the same thing on kubectl side instead of doing multiple requests to servers, and outputs should not duplicate entires.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-26 13:34:33 -08:00
Kubernetes Submit Queue c21173d0ea
Merge pull request #55792 from dhilipkumars/statefulset-appsv1
Automatic merge from submit-queue (batch tested with PRs 55792, 58342). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote Statefulset controller and its e2e tests to use apps/v1

**What this PR does / why we need it**: 
Promotes the statefulset controller to use to use the latest apps group [apps/v1](https://github.com/kubernetes/kubernetes/pull/53679)


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

**Special notes for your reviewer**:

* Listerexpansion for v1 `k8s.io/client-go/listers/apps/v1`  (was recently done for v1beta2)

* `v1beta2` && `v1` had `ObservedGeneration` as `int64` where as `v1beta1` and rest of the code (including conversion) is expecting `ObservedGeneration` to be  `*int64`

```
type StatefulSetStatus struct {
	// observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
	// StatefulSet's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
```

* for kubectl's `rollback` and `history` commands a couple functions have been duplicated to allow us to use `v1` version instead of `v1beta1` for statefulsets, while the older functions are still used by other controllers.  

We should be able to remove these duplicates once all the controllers are moved. 

If this aligns with the plan then i could move other controllers too. 

cc: @kow3ns 

**Release note**:

```release-note
NONE
```
2018-01-26 06:54:33 -08:00
Kubernetes Submit Queue 27d01b5ab9
Merge pull request #57938 from dims/add-binary-configmap
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add binary configmap

Reviving code from https://github.com/kubernetes/kubernetes/pull/33549 submitted by @zreigz

**What this PR does / why we need it**:
Add support for binary files in ConfigMap

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

**Special notes for your reviewer**:

**Release note**:

```release-note
ConfigMap objects now support binary data via a new `binaryData` field. When using `kubectl create configmap --from-file`, files containing non-UTF8 data will be placed in this new field in order to preserve the non-UTF8 data. Use of this feature requires 1.10+ apiserver and kubelets.
```
2018-01-26 04:34:33 -08:00
Kubernetes Submit Queue d352fc6f3f
Merge pull request #56829 from niuzhenguo/create-run
Automatic merge from submit-queue (batch tested with PRs 58518, 58771, 58101, 56829). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[Kubectl] Update RunCreate to follow more conventions

**What this PR does / why we need it**:
Make RunCreate with options like other commands, and abstract raw() into separated func.

**Release note**:

```release-note
NONE
```
2018-01-26 01:03:41 -08:00
Zhenguo Niu 6be1b975d2 Make REST mappings for resources a unique list
This ensures the mappings list for resources(shortcuts, plural) unique,
instead of doing multiple requests to server for the same resource.
2018-01-26 15:46:35 +08:00
Jordan Liggitt e1e1be74da
Prefer exact resource name matches to shortname expansions 2018-01-26 01:45:38 -05:00
Kubernetes Submit Queue 617c87ba06
Merge pull request #58741 from dixudx/fix_kubectl_alias_group
Automatic merge from submit-queue (batch tested with PRs 58302, 58782, 58555, 58741). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use containing API group when resolving shortname from discovery

**What this PR does / why we need it**:
kubectl does not use containing API group when resolving shortname from discovery 

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

**Special notes for your reviewer**:
/assign @liggitt 
/cc @nikhita @zjj2wry 
**Release note**:

```release-note
use containing API group when resolving shortname from discovery
```
2018-01-25 11:43:57 -08:00
Maciej Szulik c7efab40b6 Fix kubectl explain for cronjobs 2018-01-25 16:10:31 +01:00
Di Xu 97ec47ba55 use containing API group when resolving shortname from discovery 2018-01-25 09:38:34 +08:00
Kubernetes Submit Queue 3cbb62b6bb
Merge pull request #56206 from brancz/top-metrics-s
Automatic merge from submit-queue (batch tested with PRs 56206, 58525). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: Use metrics-server for kubectl top commands

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

This PR implements support for the kubectl top commands to use the metrics-server as an aggregated API, instead of requesting the metrics from heapster directly. If the `metrics.k8s.io` API is not served by the apiserver, then this still falls back to the previous behavior.

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

Fixes #55489

**Special notes for your reviewer**:

As utilizing heapster as well as the v1alpha1 version of the metrics API is discouraged, I intentionally implemented the support very separated, so that once it is decided, that support is entirely removed, this will make it easy.

**Release note**:

```release-note
Support metrics API in `kubectl top` commands.
```

/cc @kubernetes/sig-instrumentation-pr-reviews @DirectXMan12 @fgrzadkowski @piosz
2018-01-23 13:17:31 -08:00
Lukasz Zajaczkowski 7e158fb4f6 Add support for binary file in configmap 2018-01-23 07:28:34 -05:00
Kubernetes Submit Queue 2a04c09027
Merge pull request #58144 from tomerf/kubectl_cp_prefix
Automatic merge from submit-queue (batch tested with PRs 58144, 57149). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixed crash in kubectl cp when path has multiple leading slashes

**What this PR does / why we need it**: Fixed crash in kubectl cp when path has multiple leading slashes
For example:
```
$ kubectl cp pod://path/to/somewhere localfile
tar: Removing leading `//' from member names
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
k8s.io/kubernetes/pkg/kubectl/cmd.untarAll(0x363e840, 0xc420198120, 0x7fff5fbffc13, 0x1, 0x7fff5fbffbfa, 0x18, 0x0, 0x0)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/cp.go:329 +0x7b4
k8s.io/kubernetes/pkg/kubectl/cmd.copyFromPod(0x3671940, 0xc420261dd0, 0xc4202f9200, 0x3644480, 0xc42000c020, 0x0, 0x0, 0x7fff5fbffbed, 0xb, 0x7fff5fbffbf9, ...)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/cp.go:237 +0x375
k8s.io/kubernetes/pkg/kubectl/cmd.runCopy(0x3671940, 0xc420261dd0, 0xc4202f9200, 0x3644480, 0xc42000c018, 0x3644480, 0xc42000c020, 0xc4203490a0, 0x2, 0x2, ...)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/cp.go:134 +0x35b
k8s.io/kubernetes/pkg/kubectl/cmd.NewCmdCp.func1(0xc4202f9200, 0xc4203490a0, 0x2, 0x2)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/cp.go:72 +0x89
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc4202f9200, 0xc420348ee0, 0x2, 0x2, 0xc4202f9200, 0xc420348ee0)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:603 +0x234
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc42038d440, 0x8000104, 0x0, 0xffffffffffffffff)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:689 +0x2fe
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(0xc42038d440, 0xc420261dd0, 0x3644440)
	/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:41 +0xd5
main.main()
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:27 +0x26
```

**Which issue(s) this PR fixes** None

**Special notes for your reviewer**: None

**Release note**:
```release-note
Fixed crash in kubectl cp when path has multiple leading slashes
```
2018-01-22 19:02:27 -08:00
Frederic Branczyk b1448adb59
kubectl: Use metrics-server for kubectl top commands 2018-01-22 21:45:06 +01:00
juanvallejo 13add66f1e
tolerate more than one gvklist item
Some third-party resources could be part of more than one api group.
Allow this to be the case when adding openapi models to openapi data.
2018-01-19 14:24:03 -05:00
Louis Taylor b0f8a541fa
kubectl: make error with resource list prettier
Previously, running commands like `kubectl get` with no further
arguments would print a list of valid resource types with an error
messages formatted like so:

    <snip>
      * serviceaccounts (aka 'sa')
      * services (aka 'svc')
      * statefulsets (aka 'sts')
      * storageclasses (aka 'sc')error: Required resource not specified.
    Use "kubectl explain <resource>" for a detailed description of that resource (e.g. kubectl explain pods).
    See 'kubectl get -h' for help and examples.

This commit adds extra spacing so it now looks pretty:

    <snip>
      * serviceaccounts (aka 'sa')
      * services (aka 'svc')
      * statefulsets (aka 'sts')
      * storageclasses (aka 'sc')

    error: Required resource not specified.
    Use "kubectl explain <resource>" for a detailed description of that resource (e.g. kubectl explain pods).
    See 'kubectl get -h' for help and examples.
2018-01-18 22:19:44 +00:00
Kubernetes Submit Queue 44d0ba29d3
Merge pull request #56960 from islinwb/remove_unused_code_ut_pkg
Automatic merge from submit-queue (batch tested with PRs 53631, 56960). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove unused code in UT files in pkg/

**What this PR does / why we need it**:
Remove unused code in UT files in pkg/ .

**Release note**:

```release-note
NONE
```
2018-01-18 02:41:29 -08:00
Kubernetes Submit Queue 048757b8a5
Merge pull request #53631 from dixudx/enforce_cobra_required_flags
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update vendor spf13/cobra to enforce required flags

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

spf13/cobra#502 has enforced checking flags that marked as required, an error will be raised if unset.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:fixes #54855
xref #48400
fixes kubernetes/kubectl#121 

**Special notes for your reviewer**:
/assign @liggitt @eparis 

**Release note**:

```release-note
kubectl now enforces required flags at a more fundamental level
```
2018-01-18 02:00:27 -08:00
dhilipkumars aba725a391 Promote SS to apps/v1 2018-01-18 13:48:52 +05:30
David Eads d7ddcca231 low hanging fruit for using cobra commands 2018-01-17 13:43:43 -05:00
David Eads 49f12fa70f fail earlier on discovery failures 2018-01-16 16:02:13 -05:00
Kubernetes Submit Queue b04c28e80e
Merge pull request #57381 from niuzhenguo/get-raw-cleanup
Automatic merge from submit-queue (batch tested with PRs 52912, 57381). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add more validators when run kubectl get with --raw

**What this PR does / why we need it**:
1. Make --raw and --output mutually exclusive for kubectl get cmd
2. Add url/ParseRequestURI check for the specified raw URI

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-15 22:13:33 -08:00
Kubernetes Submit Queue 1a341f6b88
Merge pull request #52912 from zjj2wry/rollout-status
Automatic merge from submit-queue (batch tested with PRs 52912, 57381). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

bug(cli):fix kubectl rollout status not recoginze resource namespace

**What this PR does / why we need it**:
Fixes #42364

**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**:
cc @kubernetes/sig-cli-pr-reviews

**Release note**:

```release-note
NONE
```
2018-01-15 22:13:30 -08:00
Kubernetes Submit Queue f008f147f8
Merge pull request #52321 from Mashimiao/factory-tfix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

small tfix in cmd factory comment

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>

**What this PR does / why we need it**:
tfix in cmd factory comment

**Release note**:
```release-note
NONE
```
2018-01-15 11:34:48 -08:00
Nikhita Raghunath 5cdd4dcbd5 kubectl scale: support Unstructured objects 2018-01-15 17:01:45 +05:30
linweibin fa8afc1d39 Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
Kubernetes Submit Queue 52a2256b1a
Merge pull request #57843 from p0lyn0mial/wire_generic_scaler
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

wires the generic scaler to kubectl

**What this PR does / why we need it**:
the changes introduced in this commit plumbs in the generic scaler to kubectl.
note that we don't change the behaviour of kubectl.
For example it won't scale new resources. That's the end goal.
The first step is to retrofit existing code to use the generic scaler.

**Release note**:

```release-note
NONE
```
2018-01-13 01:26:24 -08:00
Kubernetes Submit Queue 4bc93609ea
Merge pull request #56713 from juanvallejo/jvallejo/handle-ds-pod-drain-local-storage
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow kubectl drain to continue w ds-managed pods with local storage

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

Prevents oadm drain from failing if it encounters DaemonSet-managed pods
that have local storage, when the option to ignore DaemonSet-managed
pods has been specified.

Will add a test

cc @kubernetes/sig-cli-misc @deads2k @fabianofranz @dustymabe
2018-01-12 23:05:46 -08:00
p0lyn0mial dd9de90b0a the changes introduced in this commit plumbs in the generic scaler into kubectl.
note that we don't change the behaviour of kubectl.
For example it won't scale new resources. That's the end goal.
The first step is to retrofit existing code to use the generic scaler.
2018-01-12 09:21:18 +01:00
Kubernetes Submit Queue 4a77bd53e8
Merge pull request #57259 from ericchiang/client-go-no-cache-import
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go: remove import of github.com/gregjones/httpcache

Moves NewCacheRoundTripper from `k8s.io/client-go/transport` to its own package. This prevents Kubernetes clients from requiring its dependencies.

This change removes the following transitive imports from `k8s.io/client-go/kubernetes`

```
github.com/google/btree
github.com/gregjones/httpcache
github.com/gregjones/httpcache/diskcache
github.com/peterbourgon/diskv
```


```release-note
NONE
```
2018-01-11 01:25:50 -08:00
Tomer Froumin 52f02c42e6 Fixed crash when path has multiple leading slashes 2018-01-11 10:46:22 +02:00
Kubernetes Submit Queue ba57ff9875
Merge pull request #57112 from aramase/kubectl-fixes
Automatic merge from submit-queue (batch tested with PRs 58025, 57112, 57879, 57571, 58062). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typos in kubectl pkg

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-10 11:46:43 -08:00
Kubernetes Submit Queue 91884464d2
Merge pull request #56919 from dixudx/refactor_get_uninitialized
Automatic merge from submit-queue (batch tested with PRs 49874, 56919, 57246). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

refactor getting uninitialized in kubectl get

**What this PR does / why we need it**:
remove leftover TODO to refactor getting uninitialized in kubectl get

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

**Special notes for your reviewer**:
/assign @smarterclayton 

**Release note**:

```release-note
None
```
2018-01-10 08:15:44 -08:00
Ahmet Alp Balkan ee0351320e
cmd/kubectl: fix broken error formatting for run
This patch adds missing value to a format string (%s) in --restart flag
validation for "kubectl run".

"kubectl run --restart=foo" was giving error:

    error: invalid restart policy: %!s(MISSING)

Now it says:

    error: invalid restart policy: foo

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-01-09 17:00:35 -08:00
Kubernetes Submit Queue b2ffdb73ac
Merge pull request #57511 from niuzhenguo/show-kind
Automatic merge from submit-queue (batch tested with PRs 57511, 57978). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Small improvement of showKind get

**What this PR does / why we need it**:
Given the complexity of determining whether to show resource with kind, this PR will be a small improvement when with `--show-kind=true`. There's no need to waste time to run the complex logic if we already decided to show resource with kind.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-09 15:19:30 -08:00
Zhenguo Niu 3d75e990c3 [Kubectl] Update RunCreate to follow more conventions 2018-01-09 15:45:26 +08:00
Zhenguo Niu c3d77eea54 Abstract cmd valid args get behind the factory 2018-01-09 09:58:07 +08:00
Eric Chiang ea085e0a32 client-go: remove import of github.com/gregjones/httpcache 2018-01-08 09:54:12 -08:00
juanvallejo d4e17cb7b4
Allow oadm drain to continue w ds-managed pods w local storage 2018-01-08 11:51:15 -05:00
Kubernetes Submit Queue 7a58a5caee
Merge pull request #55576 from miaoyq/using-sort.slice
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Simplify the sorting codes

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-01-07 12:06:04 -08:00
Kubernetes Submit Queue a2bce0d74e
Merge pull request #56769 from dixudx/forbid_unnamed_context
Automatic merge from submit-queue (batch tested with PRs 57521, 56769). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

forbid unnamed context

**What this PR does / why we need it**:
forbid unnamed contexts with validation

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

**Special notes for your reviewer**:
/assign @sttts @fabianofranz 

**Release note**:

```release-note
forbid unnamed context
```
2018-01-07 11:19:45 -08:00
Di Xu 792a229936 forbid unnamed context 2018-01-07 10:52:03 +08:00
Anish Ramasekar c322f1d065
fix typos in kubectl pkg 2018-01-05 21:04:44 -06:00
Jonathan Basseri 30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00
Zhenguo Niu 93b11ad12d Small improvement of showKind get 2018-01-05 18:36:14 +08:00
Kubernetes Submit Queue f875756902
Merge pull request #57021 from lcfang/delkuctl
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

delete the unused function in kubectl

**What this PR does / why we need it**:
delete some unused code in `kubctl`
2018-01-04 14:11:54 -08:00
Maciej Szulik 2f9532f047 Allow kubectl set image/env on a cronjob 2018-01-04 10:27:37 +01:00