Commit Graph

166 Commits (c582a37cae02b4d1a850e6668ea8ea0a81dcd204)

Author SHA1 Message Date
David Eads 9fe20cfd46 make delete waits match on UID 2018-07-12 14:48:13 -04:00
juanvallejo ebd48f26e5
switch delete strategy to background deletion 2018-07-09 13:34:00 -04:00
Janet Kuo 538ed3b847 Remove kubectl delete hack that handles DaemonSet deletion 2018-06-26 18:16:55 -07:00
Kubernetes Submit Queue a3fd45281a
Merge pull request #65370 from deads2k/cli-78-delete-verb
Automatic merge from submit-queue (batch tested with PRs 65377, 63837, 65370, 65294, 65376). 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 should tolerate a failed wait because of missing verbs

The power and ability to delete does not imply the power and ability to watch.  We correctly handled missing power (authz), but failed to account for ability (method not supported)

@kubernetes/sig-cli-maintainers 
@soltysh 

```release-note
Tolerate missing watch permission when deleting a resource
```
2018-06-22 16:16:11 -07:00
David Eads 2c514b5b1d delete should tolerate a failed wait because of missing verbs 2018-06-22 09:08:51 -04:00
David Eads 0e3f921457 make sure delete waiting doesn't re-evaluate the resource lists 2018-06-22 08:54:00 -04:00
Janet Kuo 710d524b98 Add TODO for removing kubectl DaemonSet deletion hack 2018-06-06 11:11:35 -07:00
Janet Kuo fedd5d6206 Revert "Remove hack in kubectl delete that handles DaemonSet deletion"
This reverts commit 10a12ddb34.
2018-06-06 11:01:35 -07:00
Janet Kuo 10a12ddb34 Remove hack in kubectl delete that handles DaemonSet deletion 2018-06-05 17:03:54 -07:00
David Eads cb09607536 fix the delete result being used 2018-05-29 08:34:47 -04:00
Nail Islamov 6f1b178ed7
Declare wait flag in way consistent with other deletion flags 2018-05-29 08:19:06 +10:00
David Eads c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
juanvallejo d463bbddb1
move resource builder flags to genericclioptions 2018-05-28 11:08:58 +02:00
Maciej Szulik b8b4c7c81b
Handle DaemonSet removal the old way 2018-05-25 22:18:10 +02:00
Maciej Szulik 383872615d
Remove kubectl reapers 2018-05-25 22:18:05 +02:00
Nail Islamov 3b5afd8809
Use DeleteOptions.PropagationPolicy instead of OrphanDependents (deprecated) in kubectl 2018-05-23 16:59:53 +10:00
David Eads 49258593c3 add a discarding printer for testing and delegation 2018-05-22 08:47:42 -04:00
David Eads 76794643c5 add wait 2018-05-22 08:47:42 -04:00
David Eads 0db40da909 update factory interface to overlap with lower RESTClientGetter 2018-05-17 08:27:53 -04:00
David Eads 16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
Kubernetes Submit Queue a67ccaeab1
Merge pull request #63536 from deads2k/cli-51-streams
Automatic merge from submit-queue (batch tested with PRs 63070, 63536). 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 IOStreams for cli commands

Scrubs the last commands to use IOStreams for consistency and testability.

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

```release-note
NONE
```
2018-05-08 14:14:20 -07:00
Kubernetes Submit Queue f9fd3c89e7
Merge pull request #63490 from deads2k/cli-48-delete
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). 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>.

default the ignorenotfound for delete when selecting objects

When selecting resources and then deleting them (as opposed to specifically indicating a resource to delete) we should default to not failing if something disappeared partway through.  This is quite common when label selecting deletes and GC runs before you get to a dependent object.

I also took the liberty of doing complete work in complete instead of validate.

```release-note
`kubectl delete` with selection criteria defaults to ignoring not found errors
```

@kubernetes/sig-cli-maintainers
2018-05-08 13:16:14 -07:00
David Eads facd04be43 use IOStreams for cli commands 2018-05-08 09:02:34 -04:00
juanvallejo a74b28d961 rm GetStandardPrinter 2018-05-07 15:37:55 -04:00
juanvallejo 5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
David Eads 4ae3f882be default the ignorenotfound for delete when selecting objects 2018-05-07 12:38:18 -04:00
Kubernetes Submit Queue 238fda9e52
Merge pull request #63318 from deads2k/cli-40-mapperfunc
Automatic merge from submit-queue (batch tested with PRs 63315, 63383, 63318, 63439). 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>.

drive resourcebuilder from kubeconfig, allow scheme specification

This updates the resource builder to work based on a kubeconfig to allow future chaining of flags.  It also allow specification of the scheme you want for your actual decoding.


@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-04 12:41:12 -07:00
David Eads b8aa7baa7d simplify resource builder usage 2018-05-04 13:02:49 -04:00
Jordan Liggitt 4dfd26a4f2
Switch kubectl resource completion to discovery 2018-05-04 09:57:36 -04:00
Jordan Liggitt 8a3125bb99
Add field selector support to delete, label, annotate 2018-04-24 16:18:04 -04:00
David Eads f01e16bb3e remove flags deprecated in 1.5 2018-04-19 08:08:44 -04:00
juanvallejo 285d696157
add delete flags 2018-04-16 16:48:39 -04:00
juanvallejo ecaddbfc36
update delete, replace, run cmds 2018-04-16 16:48:39 -04:00
Chao Wang 4e6a430bce `--force` only takes effect when `--grace-period=0` 2018-03-21 16:28:52 +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
Di Xu d1725fc683 kubectl: flag value bindings for common utils 2018-02-24 17:31:02 +08:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05: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
Di Xu e45117856e kubectl: cannot set --all and --selector at the same time 2018-02-06 23:55:36 +08: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
Zhenguo Niu c3d77eea54 Abstract cmd valid args get behind the factory 2018-01-09 09:58:07 +08:00
Di Xu 1c715d51c4 some code change
fix wrong required flags

disable the addition of [flags] to the usage, use customized useline

fix function rename
2017-12-25 16:23:38 +08:00
Clayton Coleman 5038eb2a3f
Remove use of VersionedObject and simplify builder in generic methods
Reduce all uses of Unstructured to the simpler form, and avoid asking
for mapper or typer unless it is required. Use Typed() for places that
previously used VersionedObject, and remove paths for versioned objects
from code that is now using unstructured.
2017-11-19 19:16:49 -05:00
Clayton Coleman 98e0c69907 Revert "refactor builder in kubectl factory"
This reverts commit 06c5be9802.
2017-11-19 19:02:21 -05:00
juanvallejo 701d6536a2
move cmd/util/printing.go#PrintSuccess to factory_builder.go 2017-11-15 10:46:39 -05:00
ymqytw 06c5be9802 refactor builder in kubectl factory 2017-11-07 20:16:27 -08:00
Di Xu 057b7bf767 rename selector to labelSelector 2017-11-06 14:30:20 +08:00
juanvallejo 90d76adb4b
add Local and Unstructured builder attributes
Moves DisabledClientMapperForMapping wrapper to new Local attribute.
Removes Factory#NewUnstructuredBuilder in favor of new Unstructured
builder attribute.
2017-09-05 11:57:00 -04:00
Kubernetes Submit Queue 156c4b443b Merge pull request #48582 from fabianofranz/fixes_grace_period_in_delete
Automatic merge from submit-queue

Fixes grace period in delete

**What this PR does / why we need it**:  Fixes `kubectl delete` ignoring `--grace-period`. 

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/openshift/origin/issues/15060 found in OpenShift.

**Release note**:

```release-note
NONE
```
2017-09-04 00:03:01 -07:00