Commit Graph

64 Commits

Author SHA1 Message Date
Ilya Dmitrichenko
6d7a9048b6
Move printers & resources packages
These packages deserve to live at the top level of `k8s.io/cli-runtime`,
as they are potentially of wider use than genericclioptions.
2019-03-07 23:00:24 +00:00
Jordan Liggitt
17aa60686e Deprecate and remove use of alpha metadata.initializers field, remove IncludeUninitialized options 2019-01-23 16:34:43 -05:00
Yang Li
141d33a2a5 Fix some golint errors for packages in pkg/kubectl/cmd
Co-authored-by: Arijit Basu <sayanarijit@gmail.com>
2018-11-22 22:09:08 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Maciej Szulik
21789b85a6
Move pkg/kubectl/cmd/templates -> pkg/kubectl/util/temlpates 2018-10-11 22:01:03 +02:00
Christoph Blecker
97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
Antoine Pelisse
967280b58e Add --server-dry-run flag to kubectl apply 2018-09-02 13:13:46 -07:00
Maciej Szulik
5b55e1f8ed
Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
David Eads
4b836d77d5 update set selector to use resource builder flags 2018-05-29 12:47:19 -04:00
David Eads
c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
Kubernetes Submit Queue
b143093a62
Merge pull request #64111 from juanvallejo/jvallejo/move-more-helpers
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>.

Move CanBeExposed helper from factory_client_access

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

Moves additional helpers from the "factory_client_access". Continues work from https://github.com/kubernetes/kubernetes/pull/63984 and https://github.com/kubernetes/kubernetes/pull/63884

Moves CanBeExposed from factory_client_access.

cc @soltysh
2018-05-23 13:50:02 -07:00
juanvallejo
fb0794976a move Pauser and Resumer from the factory 2018-05-23 10:27:20 -04:00
juanvallejo
0d3e85608f move f.Command out of the factory 2018-05-22 13:31:01 -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
d2952c0b2e
Merge pull request #63803 from deads2k/cli-58-set-versioned
Automatic merge from submit-queue (batch tested with PRs 63272, 63782, 63715, 63811, 63803). 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>.

switch to versioned objects only for set

Only used versioned types in the `kubectl set` commands.  This has long been the goal and we finally make it so here.

@liggitt @soltysh as promised in earlier pulls when I asked you to go with it while I unwound the debt.  This frees the entire package.



```release-note
NONE
```
2018-05-15 05:08:20 -07:00
David Eads
3af9e75950 switch to versioned objects only for set 2018-05-14 11:40:11 -04:00
Di Xu
e8ef744493 fix missing flag value bindings in kubectl 2018-05-14 14:38:54 +08: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
b8aa7baa7d simplify resource builder usage 2018-05-04 13:02:49 -04:00
David Eads
1e5372b620 get the resource.Info out of the conversion business 2018-05-01 07:58:42 -04:00
David Eads
1cb797e355 acknowledge that creation of a restmapper can fail and that we cannot have a default 2018-05-01 07:52:51 -04:00
David Eads
5432ef5c45 divide statically known typer from dynamically derive restmapper 2018-04-27 11:15:05 -04:00
David Eads
6fbcbc994f remove unnecessarily flexibiliy to simplify the resource builder 2018-04-27 09:27:51 -04:00
David Eads
8c1b687356 update more commands for iostreams 2018-04-25 08:45:15 -04:00
David Eads
ecd9a6be2e final record flag cleanup 2018-04-19 14:56:00 -04:00
David Eads
484d81ab01 use recordFlags 2018-04-19 08:50:01 -04:00
David Eads
01609036c2 use standard interface functions for printers 2018-04-12 16:02:30 -04:00
juanvallejo
2a202cf49a
update PrintFlags#Complete to receive string template 2018-04-06 16:44:40 -04:00
juanvallejo
b8dc20646c
wire printflags through set cmds 2018-04-06 10:48:36 -04: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
David Eads
dd6405681f cleanup printers some more 2018-02-20 12:59:40 -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
04ab96d2bd
Unify Object and UnstructuredObject
The unified RESTMapper and Typer follow the new rules, but on error will
fallback to the legacy path (while still supporting Unstructured
objects). This allows callers to handle the appropriate distinction
themselves if necessary.

Add a LocalParam() method to the resource.Builder that DRYs up a large
chunk of complicated code in set commands.
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
zhengjiajin
1fa1e8dac1 use versionedObject replace internal in kubectl set selector 2017-11-13 14:27:59 +08:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
ymqytw
06c5be9802 refactor builder in kubectl factory 2017-11-07 20:16:27 -08:00
Kubernetes Submit Queue
5c1d748794 Merge pull request #50584 from xilabao/fix-set-output-01
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>.

fix kubectl set resource/selector/subject output

**What this PR does / why we need it**:
kubectl set resource/selector/subject -o yaml doesn't return the expected format

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/kubernetes/kubectl/issues/51

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-28 11:05:41 -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
juanvallejo
c10f4f78bc
add err message if <rsrc>/<name> pairs specified under --local 2017-09-05 11:04:39 -04:00
Di Xu
be0cadde2e enforce include-uninitialized in several kubectl commands 2017-08-31 16:30:56 +08:00
ymqytw
b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00