Commit Graph

56 Commits

Author SHA1 Message Date
WanLinghao
9407e2bb43 When api-server is not avaiable, kubectl cluster-info still prints information like: the cluster is running at ...
This patch fixes this bug
2018-07-05 10:45:32 +08:00
David Eads
0db40da909 update factory interface to overlap with lower RESTClientGetter 2018-05-17 08:27:53 -04:00
David Eads
16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
David Eads
b8aa7baa7d simplify resource builder usage 2018-05-04 13:02:49 -04:00
David Eads
6fbcbc994f remove unnecessarily flexibiliy to simplify the resource builder 2018-04-27 09:27:51 -04:00
juanvallejo
27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
David Eads
f01e16bb3e remove flags deprecated in 1.5 2018-04-19 08:08:44 -04:00
Anish Ramasekar
c322f1d065
fix typos in kubectl pkg 2018-01-05 21:04:44 -06: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
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Di Xu
057b7bf767 rename selector to labelSelector 2017-11-06 14:30:20 +08:00
Davanum Srinivas
998f33272d Better error check for kubectl cluster-info
In RunClusterInfo, We try to connect to the api service and get some
information, but we just ignore the errors from Do().Visit(). We should
return the error returned by Do().Visit() so the "kubectl cluster-info"
would fail correctly with an error code.
2017-10-22 19:46:13 -04:00
Jordan Liggitt
0218cee931
Improve generated proxy URLs for cluster-info 2017-10-13 16:30:12 -04: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
ymqytw
b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -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
Kubernetes Submit Queue
f14618a56b Merge pull request #43622 from deads2k/cli-10-category
Automatic merge from submit-queue (batch tested with PRs 42087, 43383, 43622)

move category expansion out of restmapper

RESTMapping isn't related to CategoryExpansion (the bit that expands "all" into items to be RESTMapped).  This provides that separation and simplifies the RESTMapper interface.

@kubernetes/sig-cli-pr-reviews
2017-03-27 16:08:20 -07:00
deads2k
8895f314b4 move category expansion out of restmapper 2017-03-27 13:54:05 -04:00
Jordan Liggitt
9262c57ba8
Switch clusterinfo to print recommended proxy endpoints 2017-03-09 13:07:02 -05:00
Brendan Burns
d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Clayton Coleman
469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Phillip Wittrock
dc2fffe5d4 Improve kubectl help with examples. 2017-01-06 13:35:43 -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
deads2k
862415aaa2 make --include-extended-apis deprecated and remove plumbing 2016-09-16 16:05:52 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Brendan Burns
d8daa07f08 address comments 2016-05-16 16:50:53 -07:00
Brendan Burns
3c9fb1b651 Add a 'kubectl clusterinfo dump' option 2016-05-16 16:50:53 -07:00
Clayton Coleman
fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
Brendan Burns
be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07: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
deads2k
a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05: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
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Eric Tune
2e848ed707 Merge pull request #10585 from caesarxuchao/fix-alias
Add boundary check before accessing os.Args[1]
2015-07-15 15:00:09 -07:00
Chao Xu
48679d21d2 add boundary check before access os.Args 2015-07-09 16:15:42 -07:00
Brendan Burns
988aa6fdf6 Move things into a 'kube-system' namespace. 2015-07-06 15:08:23 -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
Chao Xu
5d89dda9a8 respect --api-version in the output of "kubectl cluster-info" 2015-06-18 16:51:10 -07:00
Piotr Szczesniak
2b19c002cb Migrated kubectl cluster-info to v1.
Addresses #7018

Also fixed the case when kubernetes.io/name label is not defined
(another fix for #9875)
2015-06-17 15:21:05 +02:00
Justin Santa Barbara
3884d5fc59 Add LoadBalancer status to ServiceStatus
This will replace publicIPs
2015-05-22 18:27:05 -04:00
Piotr Szczesniak
12e44ff8a9 Added label kubernetes.io/name to cluster services
The label specifies service name which is displayed in kubectl cluster-info
2015-05-11 19:35:53 +02:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Piotr Szczesniak
cfc73878b9 Added displaying external IPs to kubectl cluster-info
Fixes #7521
2015-04-30 10:47:58 +02:00
Piotr Szczesniak
9272fe2aea Updated kubectl cluster-info to show v1beta3 addresses
Fixes #7016
2015-04-29 10:54:36 +02:00
deads2k
6344cf3c3a refactor to move kubectl.cmd.Factory to kubect/cmd/util 2015-04-07 14:43:50 -04:00
Sam Ghods
ca18e86877 Make naming of kubectl subcommands consistent 2015-04-02 16:14:53 -07:00