Commit Graph

97 Commits

Author SHA1 Message Date
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
Jordan Liggitt
4dfd26a4f2
Switch kubectl resource completion to discovery 2018-05-04 09:57:36 -04:00
Maciej Szulik
b7d4f15965
Remove Factory from more Run commands 2018-04-30 19:58:54 +02:00
David Eads
b8177bb9af tighten .Info for kubectl to avoid unpredictable conversion 2018-04-26 12:47:25 -04:00
juanvallejo
27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
David Eads
ecd9a6be2e final record flag cleanup 2018-04-19 14:56:00 -04:00
David Eads
f01e16bb3e remove flags deprecated in 1.5 2018-04-19 08:08:44 -04:00
Timo Reimann
b9c1fc6f3c Support --dry-run in kubectl patch command. 2018-03-21 19:06:44 +01:00
Di Xu
cda7f95d46 flag value bindings for kubectl label/patch/taint/top commands 2018-02-24 16:37:19 +08: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
Kubernetes Submit Queue
f2ac9671f0
Merge pull request #57229 from niuzhenguo/cleanup_validargs
Automatic merge from submit-queue (batch tested with PRs 57229, 58907). 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>.

Abstract cmd valid args get behind the factory

**What this PR does / why we need it**:
This abstract retrieving the list of handled resources for valid args as a function to follow more conventions.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-27 00:31:30 -08:00
Zhenguo Niu
c3d77eea54 Abstract cmd valid args get behind the factory 2018-01-09 09:58:07 +08: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
7563a0c4d8
Remove unstructured error checking from affected code
Also remove error messages that depended on ObjectKinds() - future
changes will potentially remove this interface and the replacements here
are equivalent.
2017-11-19 19:16:50 -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
juanvallejo
4418591226
move cmd/util/printing.go#PrintResourceInfoForCommand -> factory_builder.go 2017-11-09 15:13:18 -05:00
ymqytw
06c5be9802 refactor builder in kubectl factory 2017-11-07 20:16:27 -08:00
ymqytw
4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
Dr. Stefan Schimanski
7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Kubernetes Submit Queue
e1d923a7cb Merge pull request #50532 from steveperry-53/kubectl-patch
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>.

Add YAML example to kubectl patch.

**What this PR does / why we need it**:
A YAML example has been requested for the kubectl patch reference doc.

fixes #458

**Special notes for your reviewer**:

* Added a YAML example.
* Updated the description to include JSON patch and JSON merge patch.

**Release note**:
```release-note
NONE
```
2017-09-27 00:52:53 -07:00
Kubernetes Submit Queue
4a0f41e4fa Merge pull request #52450 from juanvallejo/jvallejo/misc-err-msg-improvements
Automatic merge from submit-queue (batch tested with PRs 52485, 52443, 52597, 52450, 51971). 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>..

Error message / exit code fixes

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

Miscellaneous error message tweaks.
Makes the error message displayed in `kubectl get` more visible.
Returns exit code 1 if a patch fails.

Addresses the following downstream bugzillas:
- https://bugzilla.redhat.com/show_bug.cgi?id=1311786
- https://bugzilla.redhat.com/show_bug.cgi?id=1414227

cc @fabianofranz @kubernetes/sig-cli-misc
2017-09-23 18:48:58 -07:00
juanvallejo
dfef8574cf
error msg fixes
Miscellaneous error message tweaks.
Makes the error message displayed in `kubectl get` more visible.
Returns exit code 1 if a patch fails.
2017-09-13 17:55:29 -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
steveperry-53
88ab64c88a Add YAML example to kubectl patch. 2017-08-14 13:23:07 -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