Commit Graph

89 Commits (6536dcfdc2cc758f9ae0bec4b928cb91a0605570)

Author SHA1 Message Date
Clayton Coleman 7cdb6b169d
When --grace-period=0 is provided, wait for deletion
The grace-period is automatically set to 1 unless --force is provided,
and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not
handle scenarios where the object is deleted and a new object is created
with the same name.
2016-11-23 15:02:43 -06:00
Kubernetes Submit Queue 47519962bf Merge pull request #35484 from smarterclayton/delete_warning
Automatic merge from submit-queue

Add --force to kubectl delete and explain force deletion

--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.

Part of #34160 & #29033

```release-note
In order to bypass graceful deletion of pods (to immediately remove the pod from the API) the user must now provide the `--force` flag in addition to `--grace-period=0`.  This prevents users from accidentally force deleting pods without being aware of the consequences of force deletion.  Force deleting pods for resources like StatefulSets can result in multiple pods with the same name having running processes in the cluster, which may lead to data corruption or data inconsistency when using shared storage or common API endpoints.
```
2016-11-05 11:19:04 -07:00
deads2k 7fe9bd4c30 make kubectl delete generic 2016-11-04 07:50:31 -04:00
Clayton Coleman 6e25830378
Add --force to kubectl delete and explain force deletion
--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.
2016-11-02 17:44:05 -04:00
Fabiano Franz f6d1ac72a0 Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
Kubernetes Submit Queue ea688f5e44 Merge pull request #31276 from juanvallejo/jvallejo_update-dry-run-create
Automatic merge from submit-queue

Update kubectl create message when using --dry-run

`kubectl create <resource> <name> --dry-run` provides a misleading success
message.

When commands such as `kubectl new-app node` are run with a
`--dry-run` flag, they make this clear by appending a "(DRY RUN)"
string to the final output. `kubectl create <resource>  <name> --dry-run`
does not do this, providing a potentially misleading output.

This patch appends a "(DRY RUN)" string to the end of a successful
message of `kubectl create` subcommands that support the `--dry-run` flag.

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created
```

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created (DRY RUN)
```

**Release note**:
```release-note
release-note-none
```
2016-09-26 16:01:17 -07:00
Kubernetes Submit Queue 2941069307 Merge pull request #32894 from deads2k/cli-01-remove-arg
Automatic merge from submit-queue

make --include-extended-apis deprecated and remove plumbing

Marks a dead CLI parameter as deprecated and removes the plumbing for it.
2016-09-19 21:11:04 -07:00
deads2k 862415aaa2 make --include-extended-apis deprecated and remove plumbing 2016-09-16 16:05:52 -04:00
juanvallejo 52fc8efa55 update PrintSuccess message when using --dry-run 2016-09-15 10:11:21 -04:00
ymqytw c67a62da49 Fixes #30562: Refactor kubectl command options to use common struct for common file params 2016-09-12 11:01:37 -07:00
Kara Alexandra 4c959c0b23 Make more messages respect --quiet flag
- "If you don't see a command prompt, try pressing enter."
- "Pod "name" deleted"

Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-08 14:24:44 -07:00
Ivan Shvedunov 5ed881c6c4 Refactor Printer arguments
Fixes #21260
2016-07-14 16:23:02 +03:00
k8s-merge-robot 2da247ffbc Merge pull request #26977 from joe2far/fix-help-strings
Automatic merge from submit-queue

Make kubectl help strings consistent
2016-07-07 00:12:22 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
joe2far 25b4341dc7 Make kubectl help strings consistent 2016-06-29 12:50:24 +01:00
Michael Rubin 760b04e294 Use dedent for the kubectl commands
The one side effect is that for the "kubectl help" commands a newline
is prepended to output, which will alter the yaml output.

Here we use dedent to format the code to match the output.

hack/update-generated-docs.sh has been run and the affected files have
been added.

Note: for describe.go we added a period to the end of an output message.
2016-06-26 22:51:14 -07:00
Janet Kuo 181627e36c kubectl suggest for get (list, ps), and delete(rm) 2016-05-04 17:18:52 -07:00
Daniel Smith a42d7fa31c Merge pull request #23756 from smarterclayton/force_delete
Add a client flag to delete "--now" for grace period 0
2016-04-14 16:55:07 -07:00
Clayton Coleman ea3467f822 Add a client flag for --now delete
Is equivalent to --grace-period=0 but is more intuitive for end users.
2016-04-07 23:45:08 -04:00
Dr. Stefan Schimanski 7e0bb885f1 Make kubectl bash completion namespace aware and add noun aliases
- add namespace filtering to bash completion
- add --namespace flag bash completion
- add bash completion noun aliases
- adapt to new cobra package structure
2016-04-03 16:25:56 +02:00
Brendan Burns be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
Mike Metral 7403878ac0 allow kubectl cmd to process dirs recursively
reqs:
    - the kubectl cmd must support the -f | --filename flag
    - the kubectl cmd must support visiting a dir one level deep,
    or using more than one resource
2016-03-28 12:44:21 -07:00
AdoHe 9cc668f7c6 update commented examples just remove $ 2016-02-29 09:41:09 -05:00
AdoHe 714d12cf72 kubectl add show-labels flag to make it more readable 2016-02-04 02:08:44 -05:00
Clayton Coleman 2fd38a7dc0 Break kubectl from assuming details of codecs
Most of the logic related to type and kind retrieval belongs in the
codec, not in the various classes. Make it explicit that the codec
should handle these details.

Factory now returns a universal Decoder and a JSONEncoder to assist code
in kubectl that needs to specifically deal with JSON serialization
(apply, merge, patch, edit, jsonpath). Add comments to indicate the
serialization is explicit in those places. These methods decode to
internal and encode to the preferred API version as previous, although
in the future they may be changed.

React to removing Codec from version interfaces and RESTMapping by
passing it in to all the places that it is needed.
2016-01-22 13:27:26 -05:00
jiangyaoguo 7153ff80ff print absolute time when watch event 2015-12-05 13:52:53 +08:00
Maciej Szulik 64f778804d Remove string from Reaper.Stop signature 2015-11-17 12:09:08 +01:00
Janet Kuo 96031aaca5 Get printer from factory instead of using NewHumanReadablePrinter to retrieve handled resources 2015-09-02 15:38:40 -07:00
deads2k f1b81ff678 bind filenames var instead of looking up 2015-09-01 08:35:57 -04:00
Nikhil Jindal e690f3b3e8 Merge pull request #12900 from feihujiang/deleteMultipleResourcesWithTheSameName
Allow delete multiple resources with the same name
2015-08-24 10:40:41 -07:00
feihujiang 943c57ff4e Allow delete multiple resources with the same name 2015-08-24 15:14:01 +08:00
Zach Loafman 5ca0ca3d3f Merge pull request #9787 from feihujiang/acceptErrorLikeGoPath
Make a change to visitor to allow it to accept an error, like Go's pa…
2015-08-21 15:17:58 -07:00
feihujiang 29dc7f6ec2 Make a change to visitor to allow it to accept an error, like Go's path walker 2015-08-20 10:57:28 +08:00
Janet Kuo 44a7a52a94 Hide failed/succeeded pods in 'kubectl get pods' by default 2015-08-18 13:47:19 -07:00
Eric Paris 9b2ac7538d bashcompletions: suggest resources to delete in kubectl delete
Before this patch if you type `kubectl delete [tab][tab]` you would get
nothing.  `kubectl delete pod [tab][tab]` would show the list of pods.
This patch causes `kubectl delete [tab][tab]` to show the list of
resources like pod, service, podtemplate, serviceaccount, etc
2015-08-14 10:35:26 -04:00
Peeyush Agarwal 05e069d038 Use bash comments in kubectl examples
Comments in kubectl examples should use bash comments, not Go comments.
So, replaces // by # for example strings.
2015-08-12 19:56:23 +00:00
Eric Paris 7cbb52ce04 Use the pflag StringSlice instead of implementing it ourselves
Saves code and makes our code easier to read because we just use normal
[]string instead of custom type.
2015-08-06 19:16:13 -04:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
hurf 33fb6170f9 Use TYPE instead of RESOURCE in help string
For commands in kubectl, use TYPE in help string.
2015-08-05 16:34:48 +08:00
feihujiang fa68de4fcf Correct kubectl delete's wrong synopsis 2015-08-03 13:58:23 +08:00
Janet Kuo 0e42d0699a Add '-o name' to mutations 2015-07-27 14:06:53 -07:00
Jordan Liggitt 85fd52126d Default --ignore-not-found to true for delete --all 2015-07-23 18:08:15 -07:00
Tim Hockin f7512d007b Add munger to verify kubectl -f targets, fix docs 2015-07-16 15:39:45 -07:00
Nikhil Jindal 91fc591e5e Merge pull request #10598 from feihujiang/nameInsteadOfID
Using NAME to replace ID in help string
2015-07-02 15:26:24 -07:00
Kris Rousey ffa764d60b Unify command line namespace resolution
This change allows the namespace in kubeconfig to be overridden by
specifying the namespace in the spec file. If namespace is explicitly
provided in the command line flags and the spec file has a different
namespace, this will cause an error.
2015-07-01 12:59:17 -07:00
feihujiang 70036069ee Using NAME to replace ID in help string 2015-07-01 15:35:08 +08:00
Chao Xu ef5de91fd7 add "--force" flag to "kubectl update";
update relevant tests
2015-06-25 17:16:20 -07:00
feihujiang b41b53122a Add source in “error from server” message when using kubectl 2015-06-25 14:20:09 +08:00
Brendan Burns ab0c9b8e1e Add a custom timeout flag for stop/delete. Also try to be smarter about setting the timeout. 2015-06-03 11:21:30 -07:00