Commit Graph

97 Commits

Author SHA1 Message Date
Kubernetes Submit Queue
6e1727a865
Merge pull request #64114 from juanvallejo/jvallejo/remove-command-method-from-factory
Automatic merge from submit-queue (batch tested with PRs 59851, 64114, 63912, 64156, 64191). 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>.

move f.Command out of the factory

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

Moves the "f.Command" method out of factory_client_access

cc @soltysh
2018-05-23 09:06:11 -07:00
juanvallejo
0d3e85608f move f.Command out of the factory 2018-05-22 13:31:01 -04:00
David Eads
76794643c5 add wait 2018-05-22 08:47:42 -04:00
juanvallejo
d1603c9560 move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
David Eads
420dd9bf66 move type setting into an optional layer above normal printing 2018-05-17 17:22:12 -04:00
Kubernetes Submit Queue
143d3b8824
Merge pull request #63561 from juanvallejo/jvallejo/make-opinionated-print-flags-constructor
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). 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 legacyscheme dep from printFlags

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

Breaks PrintFlags dependency on legacyscheme
Prerequisite to https://github.com/kubernetes/kubernetes/pull/63402

cc @deads2k @soltysh
2018-05-10 14:25:16 -07:00
juanvallejo
40e52bf07d remove legacyscheme dep from printFlags 2018-05-10 14:51:12 -04:00
David Eads
16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
David Eads
facd04be43 use IOStreams for cli commands 2018-05-08 09:02:34 -04:00
juanvallejo
5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
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