Commit Graph

4834 Commits (2eb1083b9bcfbd118118f361169b327913d0d128)

Author SHA1 Message Date
Kubernetes Submit Queue 9c58985a25
Merge pull request #66519 from juanvallejo/jvallejo/switch-attch-externals
Automatic merge from submit-queue (batch tested with PRs 65730, 66615, 66684, 66519, 66510). 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 attach to use external objs

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

Updates attach command to use external versions.

cc @deads2k @soltysh
2018-08-01 15:52:16 -07:00
Kubernetes Submit Queue e322d1485d
Merge pull request #60316 from soltysh/create_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>.

Full blown kubectl create job

**What this PR does / why we need it**:
This is a followup to https://github.com/kubernetes/kubernetes/pull/60084 which adds full blown `create job` command

/assign @deads2k @juanvallejo 

**Release note**:

```release-note
Add kubectl create job command
```
2018-08-01 13:04:18 -07:00
juanvallejo 3a3633a32e
update logs 2018-08-01 10:44:44 -04:00
juanvallejo 9120557466
update attach to use external objs 2018-08-01 10:44:43 -04:00
Maciej Szulik 4ced88b162
Full blown kubectl create job 2018-08-01 15:04:04 +02:00
Kubernetes Submit Queue 007bf90e32
Merge pull request #66725 from juanvallejo/jvallejo/update-patch-return-code-logic
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 exit code to 0 if patch not needed

**Release note**:
```release-note
The `kubectl patch` command no longer exits with exit code 1 when a redundant patch results in a no-op
```

The specific logic in the `patch` command that exited with code 1, was only doing so when there was no diff between an existing object and its patched counterpart. (In case of errors, we just return those, which eventually ends up exiting with code 1 anyway). This patch removes this block, as we should not be treating patch no-ops as errors.

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

cc @soltysh
2018-08-01 03:31:35 -07:00
juanvallejo ad11a1b7a6
update exit code to 0 if patch not needed 2018-07-31 14:41:30 -04:00
Kubernetes Submit Queue 2bee858a7b
Merge pull request #66284 from stewart-yu/stewart-sharedtype-move
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>.

Move the` k8s.io/kubernetes/pkg/util/pointer` package to` k8s.io/utils/pointer`

**What this PR does / why we need it**:
Move `k8s.io/kubernetes/pkg/util/pointer` to  `shared utils` directory, so that we can use it  easily.
Close #66010 accidentally, and can't reopen it, so the same as #66010 

**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-07-30 19:50:36 -07:00
Kubernetes Submit Queue ce227b06de
Merge pull request #66558 from quasoft/depr-pod-flag
Automatic merge from submit-queue (batch tested with PRs 66593, 66727, 66558). 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>.

Mark --pod/-p flag of kubectl exec command as deprecated

**What this PR does / why we need it**:
Marks the `--pod` (`-p` shorthand) flag of kubectl `exec` command as deprecated.
Hides the flag from the help menu, but shows a message when command is executed with this flag.

**Which issue this PR fixes**:
Fixes:  https://github.com/kubernetes/kubectl/issues/104

This is a remake of PR https://github.com/kubernetes/kubernetes/pull/54629.

**Release note**:
```release-note
Flag --pod (-p shorthand) of kubectl exec command marked as deprecated
```
2018-07-27 18:05:06 -07:00
stewart-yu f1343af5d7 auto-generated file 2018-07-28 07:54:17 +08:00
stewart-yu 649b46ff1d fix verify about import error 2018-07-28 07:54:16 +08:00
Kubernetes Submit Queue 1833aabcf2
Merge pull request #66225 from charrywanganthony/edit-o-json
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). 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 error binding of edit output format

**What this PR does / why we need it**:
`kubectl edit xxx/xxx -o json` won't print result in json format
**Release note**:
```release-note
NONE
```
2018-07-27 16:42:05 -07:00
Kubernetes Submit Queue 1dd4f8d82f
Merge pull request #66554 from charrywanganthony/watch_json
Automatic merge from submit-queue (batch tested with PRs 66554, 66616, 66695, 66681). 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 the watch status when -o=yaml|json option is specfied

**Which issue(s) this PR fixes** : 
`kubectl get pods --watch -o json` only putput once and stop, this PR fix this.

**Release note**:
```release-note
NONE
```
2018-07-27 10:09:04 -07:00
Kubernetes Submit Queue 4d5d2664c3
Merge pull request #65542 from juanvallejo/jvallejo/cleanup-convert-cmd
Automatic merge from submit-queue (batch tested with PRs 66333, 65542). 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 / simplify convert command

Cleans up unnecessary pieces from the convert command, simplifyiing
command logic, and readability.

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

cc @soltysh @deads2k
2018-07-27 07:24:05 -07:00
stewart-yu 55251c716a update the import file for move util/pointer to k8s.io/utils 2018-07-27 19:47:02 +08:00
QuaSoft 75804c35aa Remove warning for deprecated flag usage as pflag already does that 2018-07-24 15:59:44 +03:00
QuaSoft 888119a47c Mark exec --pod/-p flag as deprecated 2018-07-24 11:59:37 +03:00
Chao Wang e954f9706e fix the watch status when -o=yaml|json option is specfied 2018-07-24 16:37:47 +08:00
juanvallejo 94fbb48dfc
switch logs to use external versions 2018-07-23 14:40:16 -04:00
Kubernetes Submit Queue 35ff6ea207
Merge pull request #66398 from deads2k/cli-04-make-logs-generic-again
Automatic merge from submit-queue (batch tested with PRs 66410, 66398, 66061, 66397, 65558). 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 logs command to be generic for all resources again

--all-containers should not have been allowed as it was because it only worked for pods.  This approach does not make sense for a polymorphic command.  Rather than roll it back, I'll take the time to make it generic.  Because of this and other pods-only options, we now have inconsistencies with the command that should be addressed separately.

@CaoShuFeng 
/assign @juanvallejo @soltysh 
@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-07-20 18:51:05 -07:00
Kubernetes Submit Queue 6c500be080
Merge pull request #66218 from atlassian/handle-errors
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). 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>.

Handle errors

**What this PR does / why we need it**:
This is a followup PR for https://github.com/kubernetes/kubernetes/pull/64664 to handle errors returned from `.AddToScheme()` in places where they are not handled.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
/cc @sttts
2018-07-20 12:12:15 -07:00
David Eads 5ba07364ee fix logs command to be generic for all resources again 2018-07-20 15:10:44 -04:00
Jordan Liggitt dc5f615152
Send correct headers for pod printing 2018-07-19 20:55:00 -04:00
Chao Wang 71299558c1 update testcase for edit 2018-07-18 15:41:38 +08:00
Mengqi Yu 60630eb38e add tests for polymorphichelpers pkg 2018-07-18 00:37:00 -07:00
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10:00
juanvallejo 5e79a25e0c
add support for "success" output for edit command
Adds support for the "success" printer in the "edit" command, while
ensuring outputFormat constraints for the in-editor printer.
2018-07-16 12:06:32 -04:00
Chao Wang a87b82c0ad fix error binding of edit output format 2018-07-16 14:27:20 +08:00
Kubernetes Submit Queue 2a62949899
Merge pull request #64181 from stealthybox/kubecuttle_run_help_typo
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>.

Correct image in `kubectl help run`

**What this PR does / why we need it**:
Simple typo fix -- image for this hazelcast command example was transposed /w nginx

/sig cli
/area kubectl
/kind cleanup
/kind documentation

**Release note**:
```release-note
NONE
```
2018-07-13 17:46:55 -07:00
Kubernetes Submit Queue 43d30a143b
Merge pull request #66140 from liggitt/kubectl-current-context
Automatic merge from submit-queue (batch tested with PRs 66121, 66140, 66045). 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 modifying current context with kubectl set-context

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

Enabled setting the namespace (or any other attribute) for the current context, rather than needing to provide a name:
```
kubectl config set-context --current --namespace=some-namespace
kubectl config set-context --current --cluster=some-cluster
kubectl config set-context --current --user=some-user
```

```release-note
`kubectl config set-context` can now set attributes of the current context, like the current namespace, by passing `--current` instead of a specific context name
```
2018-07-12 23:05:05 -07:00
Kubernetes Submit Queue 704b180ce6
Merge pull request #66121 from CaoShuFeng/csr_approve
Automatic merge from submit-queue (batch tested with PRs 66121, 66140, 66045). 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 csr status message for kubectl certificate deny

**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-07-12 23:05:01 -07:00
juanvallejo 4446a29440
cleanup / simplify convert command
Cleans up unnecessary pieces from the convert command, simplifyiing
command logic, and readability.
2018-07-12 18:12:37 -04:00
Jordan Liggitt fe53c618e8
Allow modifying current context with kubectl set-context 2018-07-12 17:19:01 -04:00
David Eads 9fe20cfd46 make delete waits match on UID 2018-07-12 14:48:13 -04:00
Cao Shufeng 259d39fade fix csr status message for kubectl certificate deny 2018-07-12 19:02:45 +08:00
Kubernetes Submit Queue 029213748a
Merge pull request #65908 from juanvallejo/jvallejo/switch-delete-strategy-background
Automatic merge from submit-queue (batch tested with PRs 64695, 65982, 65908). 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>.

switch delete strategy to background deletion

**Release note**:
```release-note
"kubectl delete" no longer waits for dependent objects to be deleted when removing parent resources
```

### Before 1.11.0

- Resources that had client-side reapers in older versions of the client had all of their dependents deleted first. The parent resource itself was deleted *last*. This allowed the command to be re-entrant and was largely an artifact of it **having** to be done that way by a client-side reaper.

### After 1.11.0 (with this PR)

- Resources that previously had client-side reapers are no longer deleted last (after their dependents). They are now instead deleted first. The garbage-collector server-side then deletes any dependents.
- This means that the `delete` command can return, and the parent object can be deleted while child objects still exist.
  - This is okay because the child resources are eventually deleted by the garbage collector server-side. 

cc @liggitt @soltysh
2018-07-10 08:55:15 -07:00
David Eads fabe703756 re-make print flags composeable for sophisticated callers 2018-07-10 08:08:01 -04:00
Kubernetes Submit Queue aab517313c
Merge pull request #63793 from hzxuzhonghu/kubectl-proxy-keepalive
Automatic merge from submit-queue (batch tested with PRs 63793, 65989). 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>.

Enable kubectl proxy to set tcp keepalive

**What this PR does / why we need it**:
Allows setting keepalive period for kubectl proxy.

Fixes #63727

**Special notes for your reviewer**:

/assign @brendandburns

**Release note**:

```release-note
Introduce a new flag `--keepalive` for kubectl proxy to allow setting keep-alive period for long-running request.
```
2018-07-10 02:46:01 -07:00
Kubernetes Submit Queue 24ee75e265
Merge pull request #65880 from juanvallejo/jvallejo/fix-template-printer-rollout-cmds
Automatic merge from submit-queue (batch tested with PRs 64226, 65880). 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>.

wire PrintFlags through rollout commands

Binds PrintFlags to rollout commands.
Adds tests ensuring --template printing is supported by rollout cmds.

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

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

cc @soltysh @deads2k
2018-07-09 12:16:06 -07:00
juanvallejo ebd48f26e5
switch delete strategy to background deletion 2018-07-09 13:34:00 -04:00
Kubernetes Submit Queue e049c458ed
Merge pull request #65836 from grampajoe/extra-character
Automatic merge from submit-queue (batch tested with PRs 64664, 65836, 65917). 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: Remove an extra character from rollout error message

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

Removes an extra character in a `kubectl rollout status` error message.

**Special notes for your reviewer**:

I thought this would be a good first contribution!

**Release note**:

```release-note
NONE
```
2018-07-09 08:07:00 -07:00
juanvallejo 2b0b605c80
wire PrintFlags through rollout commands
Binds PrintFlags to rollout commands.
Adds tests ensuring --template printing is supported by rollout cmds.
2018-07-06 17:32:42 -04:00
Kubernetes Submit Queue b6c52143be
Merge pull request #65838 from WanLinghao/clusterinfo_fix
Automatic merge from submit-queue (batch tested with PRs 65838, 65837). 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 cluster-info bug

**What this PR does / why we need it**:
   When api-server is not avaiable,` kubectl cluster-info `still prints information like: the cluster is running at ...
    This patch fixes this bug

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-06 11:03:01 -07:00
David Eads a31d2c44f4 flatten nested lists for flatten in visitor 2018-07-05 07:57:53 -04:00
Kubernetes Submit Queue 63c33f3812
Merge pull request #65543 from juanvallejo/jvallejo/improve-help-wait-cmd
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 help description and examples to wait

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

Adds --help description and examples to the `wait` command.

cc @soltysh
2018-07-05 04:31:48 -07:00
WanLinghao 9407e2bb43 When api-server is not avaiable, kubectl cluster-info still prints information like: the cluster is running at ...
This patch fixes this bug
2018-07-05 10:45:32 +08:00
Kubernetes Submit Queue 9899d37b59
Merge pull request #65686 from WanLinghao/priorityclass_fix
Automatic merge from submit-queue (batch tested with PRs 64593, 65117, 65629, 65827, 65686). 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 create priorityclass` failure bug

**What this PR does / why we need it**:
update` kubectl create priorityclass` command's api version.
**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 #65685 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-04 18:52:22 -07:00
Joe Friedl 74eaa3b2bc kubectl: Remove an extra character from rollout error message 2018-07-04 14:24:14 -04:00
Kubernetes Submit Queue df1826c9d7
Merge pull request #65786 from juanvallejo/jvallejo/update-template-printer-check
Automatic merge from submit-queue (batch tested with PRs 65715, 65786). 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 --template printer defaulting

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

Depends on https://github.com/kubernetes/kubernetes/pull/65711
The relevant commit for this PR is the last one (`
fix go-template defaulting for commands w default output format`)

cc @deads2k @soltysh
2018-07-04 06:18:08 -07:00
Kubernetes Submit Queue 5a7bdd3eec
Merge pull request #65715 from deads2k/cli-82-rbac-fail
Automatic merge from submit-queue (batch tested with PRs 65715, 65786). 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>.

fail on rbac resources of non-v1 versions in reconcile

Reconcile only supports rbac/v1 and other resources are skipped.  This is good, except that only RBAC resources should really fail.  This makes it fail.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-07-04 06:18:05 -07:00