Commit Graph

31 Commits (dfae1a27c245334ceaff869786f74392c8321b94)

Author SHA1 Message Date
Angus Salkeld 4a09ded01d Make kubectl label and annotate more consistent
Some of the main changes:
- add dryrun to annotate (can push this in a different PR if requested)
- use Complete(), Validate() and RunX()
- don't place dynamic variables in the options (only user options and args)
- call the NewBuilder() in the Run function.

You can now do diff between these files and they are as identical as possible.
2016-10-06 17:17:40 +10:00
Angus Salkeld b86b85dea9 Add local option to annotate 2016-10-05 14:39:56 +10: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
lojies 479ddc8818 change annotate_resources to valid_resources 2016-09-01 16:33:51 +08:00
juanvallejo 1e71359a77 fix annotate.go single resource check 2016-07-27 10:41:05 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07: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
Brendan Burns dac09311b8 Add support for labelling 3rd party objects 2016-05-23 13:13:35 -07:00
Janet Kuo 4332472bde Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
Clayton Coleman 51b624103f
Change ConvertToVersion to use GroupVersion
Long delayed refactor, avoids a few more allocations.
2016-05-12 10:10:35 -04:00
Kenjiro Nakayama 84e3ee8ec4 Update bashcompletion codes for kubectl annotate 2016-04-14 23:40:34 +09:00
k8s-merge-robot f5c93c8ddc Merge pull request #23472 from wojtek-t/fix_object_meta_for
Automatic merge from submit-queue

Switch from api.ObjectMetaFor to meta.Accessor in most of places

Fix #23278

@smarterclayton @lavalamp
2016-04-02 02:33:40 -07:00
Brendan Burns be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
Wojciech Tyczynski 2699be2e7e Switch api.ObjetaMetaFor to meta.Accessor 2016-03-31 17:52:31 +02: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
Maciej Szulik 9bfa27a5bf Fix kubectl annotate and label to use versioned objects when operating 2016-02-19 22:40:18 +01:00
Janet Kuo e3cb44aaff Copy deployment's annotations to its RC 2016-02-03 10:19:06 -08:00
Janet Kuo 5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -08:00
Jordan Liggitt d7f547b4c2 Make label/annotate commands fall back to update on patch compute failure 2016-01-25 11:57:34 -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
hurf ad26db7f45 Annotate support label
allow "kubectl annotate pods -l app=nginx"
2015-11-25 14:13:39 +08:00
Jerzy Szczepkowski cac9e88c11 Updated kubectl help messages.
Updated kubectl help messages: added info about hpa. Fixes #17357.
2015-11-19 15:26:43 +01:00
hurf ca300c180c Add printer options to Annotate
1. add return message as "resource name annotated"
2. add printer options to annotate
3. move all parameter into AnnotateOptions to make sure runT
function has no parameter.
2015-11-14 03:07:21 +08:00
Chao Xu d0d260fd03 let kubectl annotate use patch instead of replace 2015-10-14 11:14:02 -07:00
deads2k f1b81ff678 bind filenames var instead of looking up 2015-09-01 08:35:57 -04:00
hurf 961d7f995a Remove unused parameters and flags
Some params and flags are set but not used, remove them.
2015-08-27 10:40:40 +08:00