Commit Graph

45 Commits (e51752239c0c6f7974449c0c11e0f07817d08323)

Author SHA1 Message Date
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
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
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 f1de40b448 Extract some flag description strings to be translated. 2017-02-21 22:07:30 -08:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05: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
Xing Zhou 80d6cd0a40 Added bash completion for several kubectl commands.
This path added/fixed bash completion for several
kubectl commands.

Fixes #25287
2016-08-30 13:12:09 +08:00
PingWang bc3b74a499 Add validation conditions for autoscale
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

delete --min judgment

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 09:41:28 +08:00
Andrey Kurilin 91cace347d Fix various typos in kubectl 2016-08-02 19:51:51 +03:00
k8s-merge-robot c0579af684 Merge pull request #27844 from hodovska/1336632-hpa_flag_tips
Automatic merge from submit-queue

kubectl/autoscale: fix tips when validating --max flag

While autoscaling, it was not clear what was the reason of failed --max flag validation.
This fix divides reasons to:
- value not provided or too low
- value of max is lower than value of min

bug 1336632
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1336632
2016-07-06 08:40:14 -07: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
Dominika Hodovska 59db75f893 kubectl/autoscale: fix tips when validating --max flag
bug 1336632
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1336632
2016-06-22 09:51:15 +02:00
Piotr Szczesniak 1818b5b3fc Added hpa/v1 generator to kubectl autoscale 2016-06-10 09:26:35 +02:00
Jerzy Szczepkowski 47a5c17aba Fixed check in kubectl autoscale.
Fixed check in kubectl autoscale: cpu consumption can be higher than 100%. Fixes #25815.
2016-05-24 14:56:25 +02:00
Janet Kuo 4332472bde Add 'kubectl set image' 2016-05-18 21:23:17 -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
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
Janet Kuo e93b855242 Update kubectl help for 1.2 resources 2016-03-22 14:14:35 -07:00
Jordan Liggitt 560b02b3ec Prefer fetched version when determining HPA group version kind 2016-03-11 00:03:38 -05:00
AdoHe 9cc668f7c6 update commented examples just remove $ 2016-02-29 09:41: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
Michail Kargakis 71934b7643 kubectl: Validate flag usage against generators
This commit moves the generators into separate buckets and creates
separate calls for each one group. This helps in providing just the
necessary generators to each generator command.

Validation of flags against generators is also added so that flags
that are not meant to be used with a specific generator will result
in error.
2015-12-18 15:09:53 +01:00
deads2k 66eecb963a update more kubectl bits for groupversion 2015-12-07 09:01:44 -05:00
hurf 8b6ef01667 fix description of -f option of autoscale command
use 'autoscale' instead of 'get form the server'
2015-11-25 19:00:56 +08:00
k8s-merge-robot 6d2b92a0be Merge pull request #17269 from janetkuo/autoscale-deployments
Auto commit by PR queue bot
2015-11-21 22:23:23 -08:00
deads2k 303bcad398 use groupversion in RESTMapping 2015-11-16 09:22:11 -05:00
Janet Kuo 8e99bae7ec Support autoscale deployments 2015-11-13 23:33:55 -08:00
Janet Kuo a6a64820d7 Make generation of the apply annotation optional 2015-11-06 15:08:50 -08:00
deads2k fd1c8e096a eliminate cross-namespace HPA escalation attack 2015-11-03 08:05:26 -05:00
Jordan Liggitt b58e62e7d4 Pass runtime.Object to Helper.Create/Replace 2015-10-28 12:43:21 -04:00
Janet Kuo 8105aa44a0 Implement kubectl autoscale 2015-10-19 09:59:22 -07:00