Commit Graph

66 Commits

Author SHA1 Message Date
ymqytw
b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
deads2k
0801ded425 remove dead code 2017-07-07 09:12:29 -04:00
Alexander Campbell
6fd36c10ad kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
   For example, UsageError --> UsageErrorf.
 * Remove redundant or unreachable code.
 * Simplify some utility functions (no functionality changes).
 * Fix hanging 'if { return } else { return }' constructs.
 * Fix several incorrect printf verbs.
2017-06-27 16:25:20 -07:00
juanvallejo
d036686185
fix --local flag for kubectl set commands 2017-06-13 12:57:05 -04:00
bruceauyeung
ab4029c85b Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
rename variables to make sure that they conform to golang variable name convention
2017-04-25 15:07:01 +08:00
Brendan Burns
79f51923d3 Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
deads2k
8895f314b4 move category expansion out of restmapper 2017-03-27 13:54:05 -04:00
Jordan Liggitt
2802e5af27
Fix 'not patched' kubectl error 2017-03-02 01:00:48 -05:00
Jordan Liggitt
56d141851f
Honor output formats in kubectl patch 2017-02-27 09:20:49 -05:00
Kubernetes Submit Queue
082cfac707 Merge pull request #35408 from xilabao/add-secret-to-pflag
Automatic merge from submit-queue (batch tested with PRs 35408, 41915, 41992, 41964, 41925)

add secret option to flag

To resolve the issue of security(pr #35030 ),

> @smarterclayton commented 5 days ago
> This is unfortunately not all flags that could be secrets. The best option would be to add support in spf13/pflag to tag a flag as a secret, and then use that bit to determine the list.
> 
> Also, Command() could be used in contexts that need exact parameters (for subshell execution), so we would need to add a new method or extend the signature here to allow exact flags to be retrieved.

we could add a secret option to the flags.
2017-02-26 18:07:53 -08:00
xilabao
131802a5cd add secret flag to options 2017-02-25 23:40:50 +08:00
Clayton Coleman
2aa4abb73b
Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
Brendan Burns
d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Janet Kuo
a155111acd Print resource name when patch is done 2017-01-27 14:58:52 -08:00
Jordan Liggitt
408a978f26
fix --record to work with unstructured objects 2017-01-26 19:59:27 -05:00
Jordan Liggitt
c317f92990
patch: allow --local to use structs for strategic merge, warn about unknown objects 2017-01-26 19:59:26 -05:00
Jordan Liggitt
b6d4f371cd
patch: use unstructured objects 2017-01-26 19:59:25 -05:00
Dr. Stefan Schimanski
d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
Wojciech Tyczynski
d08abdb187 Allow for returning map[string]interface{} from patch. 2017-01-18 11:53:30 +01:00
deads2k
26c46971f2 move PatchType to apimachinery 2017-01-17 08:32:05 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
juanvallejo
7410acf4ab
Prevent "patched" output on obj not patched
This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.
2016-12-09 19:01:27 -05:00
ymqytw
f32696e734 try old patch after new patch fails 2016-11-17 14:28:09 -08:00
ymqytw
34891ad9f6 support patch list of primitives 2016-11-09 11:46:59 -08: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
Clayton Coleman
a7a7fd4631
Patch was not requesting a version to encode to 2016-08-18 14:45:01 -04: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
Dmitry Shulyak
d81f7a0f22 Use strategic patch to replace changeCause in patch command 2016-06-29 15:20:38 +03: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
deads2k
ac64404d86 let patch use local file content to mutate 2016-06-14 14:38:00 -04:00
Dawn Chen
88de86fcb9 Revert "Versioning docs and examples for v1.4.0-alpha.0."
This reverts commit cce9db3aa9.
2016-06-10 16:46:46 -07:00
David McMahon
cce9db3aa9 Versioning docs and examples for v1.4.0-alpha.0. 2016-06-10 14:55:35 -07:00
Chao Xu
216649b822 fix kubectl patch example 2016-05-31 11:45:12 -07:00
Mike Metral
999c8e211e allow kubectl subcmds to process multiple resources
- use resource.Visit() to recursively process resources, as well as, aggregate
errors where possible
2016-05-01 20:27:37 -07:00
Kenjiro Nakayama
910b6bce33 Update bashcompletion codes for kubectl patch 2016-04-14 23:40:31 +09: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
deads2k
11da9a7638 fix --record to not fail a successful patch 2016-02-19 14:28:23 -05:00
deads2k
9f003f7db3 allow patch to handle multiple types 2016-02-12 11:12:09 -05:00
Janet Kuo
5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -08: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