Commit Graph

87 Commits (284e8182a402cfd545fc000fedaea071fed873b0)

Author SHA1 Message Date
David Eads b8177bb9af tighten .Info for kubectl to avoid unpredictable conversion 2018-04-26 12:47:25 -04:00
David Eads 0710f72c65 remove confusing flexibility for metadata interpretation 2018-04-23 13:31:55 -04:00
David Eads ecd9a6be2e final record flag cleanup 2018-04-19 14:56:00 -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
Kubernetes Submit Queue 7d64d30177
Merge pull request #60094 from juanvallejo/jvallejo/remove-printobjectspecificmessage
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 f.PrintObjectSpecificMessage

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

Mailing list discussion: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/gZWg8Ulo3Ao

Removes the `PrintObjectSpecificMessage` helper in an effort to reduce printing stack complexity, and avoid special-casing resources.
2018-02-22 00:35:21 -08:00
juanvallejo e3d81517ae remove f.PrintObjectSpecificMessage 2018-02-21 21:06:49 -05:00
David Eads d8a5420b7c remove unneeded factory codec methods 2018-02-21 15:20:20 -05:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05: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 8f4b6c8771
All commands must declare Unstructured or Internal
Callers must take a dependency on one or the other set of conversions
and default client behavior. Future changes may add a Versioned() type,
but this is an accurate reflection of current code state.
2017-11-19 20:41:02 -05: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
wackxu 7a05ecd046 should check and return err when visit failure 2017-11-02 20:15:34 +08:00
Antoine Pelisse 80fd010e83 Remove swagger 1.2 validation 2017-10-03 08:18:21 -07: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
Fabiano Franz d77295677b Fixes grace period in delete 2017-09-01 12:28:18 -03:00
Antoine Pelisse b7b5457050 Validate against OpenAPI schema (if available) 2017-08-21 08:58:42 -07:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07: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
Alexander Campbell 9e7f29c3fb cmd: fix deprecation warning bug
Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl scale [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 scale [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.
2017-05-18 16:48:13 -07: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
xilabao 131802a5cd add secret flag to options 2017-02-25 23:40:50 +08:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Clayton Coleman 42d410fdde
Switch to use pkg/apis/meta/v1/unstructured and the new interfaces
Avoid directly accessing an unstructured type if it is not required.
2016-12-10 18:05:28 -05:00
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
deads2k 9260b992bf make kubectl replace generic 2016-11-04 07:50:31 -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
Michael Fraenkel c036d28689 Wait until resource is deleted before creating 2016-09-08 08:37:11 -04:00
Michael Fraenkel 88e17d7478 Require force when using grace period or timeout 2016-09-08 07:45:20 -04:00
Kris b5235bccec Make kubectl replace use dynamic clients 2016-08-15 22:07:54 -07:00
Kubernetes Submit Queue f0e5dac1f1 Merge pull request #30247 from ardnaxelarak/28695_suppress_noisy_output
Automatic merge from submit-queue

Make more messages respect --quiet flag

Make following two messages respect `--quiet` in `kubectl run`
- `If you don't see a command prompt, try pressing enter.`
- `Pod "name" deleted`

Ref #28695
2016-08-12 21:34:14 -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
juanvallejo d9dedfff5e add timeout units to cmds help example 2016-08-03 16:36:51 -04: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