Commit Graph

72 Commits (d440ecdd3b41a4fc4a207195e1bb976422d6d35e)

Author SHA1 Message Date
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
Clayton Coleman 5e905f1f5f
Move versioned generators into their own package
pkg/kubectl has a lot of files. Move everything generator related
into pkg/kubectl/generate (generic) or pkg/kubectl/generate/versioned
(type specific).

Move the DescriberFn and GeneratorFn out of kubectl/cmd/util and into
the respective versioned packages, along with tests.
2018-10-16 12:54:40 -04:00
Sean Sullivan 6a2ef97d46 kubectl: update to use correct printers package 2018-10-15 11:02:19 -07:00
k8s-ci-robot 8751c1e5a8
Merge pull request #69560 from WanLinghao/clusterrolebinding_description_improve
Improve decription of command 'kubectl create clusterrole'
2018-10-12 11:20:11 -07:00
Maciej Szulik 61899e1654
Generated changes 2018-10-11 22:01:06 +02:00
Maciej Szulik 21789b85a6
Move pkg/kubectl/cmd/templates -> pkg/kubectl/util/temlpates 2018-10-11 22:01:03 +02:00
WanLinghao 5958baa163 improve decription of command 'kubectl create clusterrole' 2018-10-09 15:50:30 +08:00
Maciej Szulik 55d5df8a36
React to moves 2018-10-06 18:44:05 +02:00
Christoph Blecker 97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
Sean Sullivan 4ad673ce41 Replace internal version Encoder with external version encoder for create and create_test. 2018-09-20 13:49:06 -07:00
Antoine Pelisse 967280b58e Add --server-dry-run flag to `kubectl apply` 2018-09-02 13:13:46 -07:00
Maciej Szulik ace8386d13
Get rid of argsLenAtDash in create job 2018-08-22 15:23:15 +02:00
Maciej Szulik 59fc12006b
Fix NameFromCommandArgs when passing command after -- 2018-08-22 15:23:13 +02:00
Maciej Szulik 5b55e1f8ed
Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
Kenjiro Nakayama 9cb24c4680 `kubectl create {clusterrole,role}`'s `--resources` flag support asterisk to specify all resources 2018-08-09 08:40:12 +09:00
Kubernetes Submit Queue 6d0a86220f
Merge pull request #66926 from deads2k/kubectl-04-easy-scheme
Automatic merge from submit-queue (batch tested with PRs 62901, 66562, 66938, 66927, 66926). 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>.

 snip legacy scheme uses we don't need

the legacy scheme covers the kubectl scheme. This pull converts many of the "simple" ones we can clear. I also cleared out create entirely.

@kubernetes/sig-cli-maintainers 
/assign @soltysh @juanvallejo 

```release-note
NONE
```
2018-08-02 19:57:22 -07:00
Kubernetes Submit Queue cf986d2bbe
Merge pull request #66927 from deads2k/kubectl-05-client-go
Automatic merge from submit-queue (batch tested with PRs 62901, 66562, 66938, 66927, 66926). 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>.

snip links to internal clients

This is just an example of snipping links to the internal client from k/k.  There are four more direct links to the factory method to create the internal and order of a dozen imports.

@kubernetes/sig-cli-maintainers 
/assign @soltysh @juanvallejo 

```release-note
NONE
```
2018-08-02 19:57:18 -07:00
David Eads 7923a9fd99 snip links to internal clients 2018-08-02 14:53:22 -04:00
David Eads 937d45a809 remove legacy scheme from create 2018-08-02 14:49:31 -04:00
David Eads dd2af1c8a4 snip legacy scheme uses we don't need 2018-08-02 14:17:17 -04:00
Antoine Pelisse 71970d6475 dry-run: Update DynamicClient to pass Create/Update options 2018-08-02 10:38:31 -07:00
Maciej Szulik 4ced88b162
Full blown kubectl create job 2018-08-01 15:04:04 +02:00
Chao Wang a87b82c0ad fix error binding of edit output format 2018-07-16 14:27:20 +08:00
David Eads 70417ca150 make template printers a recommended printer 2018-07-03 07:47:17 -04:00
David Eads 52d45cfd4f move template printers to genericclioptions 2018-07-03 07:46:51 -04:00
WanLinghao 33e2b8a699 fix a typo error 2018-07-02 14:55:49 +08:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Kubernetes Submit Queue 02dba36128
Merge pull request #65019 from mirake/fix-typo-toto
Automatic merge from submit-queue (batch tested with PRs 65265, 64822, 65026, 65019, 65077). 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>.

Typo fix: toto -> to
2018-06-21 11:25:16 -07:00
ruicao 95c232ee07 Typo fix: toto -> to 2018-06-12 23:12:39 +08:00
Jordan Liggitt 1034efd439
Allow non-RBAC authorizers to participate in role/clusterrole escalation checks 2018-06-06 15:31:05 -04:00
Kubernetes Submit Queue bf422b7b04
Merge pull request #64371 from CaoShuFeng/invalid_o
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 -o

Fix kubectl -o error message:
Before this change:
```
kubectl get pods -o foo
error: unable to match a printer suitable for the output format "" and the options specified: &get.PrintFlags{JSONYamlPrintFlags:(*genericclioptions.JSONYamlPrintFlags)(0x23aa610), NamePrintFlags:(*genericclioptions.NamePrintFlags)(0xc42058b4e0), TemplateFlags:(*printers.KubeTemplatePrintFlags)(0xc4206765e0), CustomColumnsFlags:(*printers.CustomColumnsPrintFlags)(0xc420676620), HumanReadableFlags:(*get.HumanPrintFlags)(0xc4204eb180), NoHeaders:(*bool)(0xc4206fefbc), OutputFormat:(*string)(0xc42058b4d0)}
```

After this change:
```
Kubectl get pods -o foo
error: unable to match a printer suitable for the output format "foo", allowed formats are: json,yaml,name,template,go-template,go-template-file,templatefile,jsonpath,jsonpath-file,custom-columns-file,custom-columns,wide
```



**What this PR does / why we need it**:

**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
kubectl will list all allowed print formats when an invalid format is passed.
```
2018-06-06 04:15:56 -07:00
Cao Shufeng 995c5a07ea fix kubectl -o
Fix kubectl -o error message:
Before this change:
```shell
kubectl get pods -o foo
error: unable to match a printer suitable for the output format "" and the options specified: &get.PrintFlags{JSONYamlPrintFlags:(*genericclioptions.JSONYamlPrintFlags)(0x23aa610), NamePrintFlags:(*genericclioptions.NamePrintFlags)(0xc42058b4e0), TemplateFlags:(*printers.KubeTemplatePrintFlags)(0xc4206765e0), CustomColumnsFlags:(*printers.CustomColumnsPrintFlags)(0xc420676620), HumanReadableFlags:(*get.HumanPrintFlags)(0xc4204eb180), NoHeaders:(*bool)(0xc4206fefbc), OutputFormat:(*string)(0xc42058b4d0)}
```

After this change:
```shell
Kubectl get pods -o foo
error: unable to match a printer suitable for the output format "aaa", allowed formats are: custom-columns,custom-columns-file,go-template,go-template-file,json,jsonpath,jsonpath-file,name,template,templatefile,wide,yaml
```
2018-06-05 19:49:07 +08:00
Kubernetes Submit Queue d373eaa4f3
Merge pull request #63724 from ravisantoshgudimetla/priority-e2e-beta
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>.

Modify e2e tests to use priorityClass beta client version & switch priorityClass to beta

**What this PR does / why we need it**:
/cc @bsalamat @aveshagarwal @liggitt 

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

**Special notes for your reviewer**:
Once #57963 merges, this could go in.

**Release note**:

```release-note
Modify e2e tests to use priorityClass beta version & switch priorityClass feature to beta
```
2018-06-04 23:07:34 -07:00
David Eads c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
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
Kubernetes Submit Queue 007e936c6d
Merge pull request #63851 from WanLinghao/ctl_create_aggegated_rules
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). 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>.

Make kubectl could create clusterrole with aggregation rules

**What this PR does / why we need it**:
The clusterrole aggregation rule features are available since v1.9:
https://kubernetes.io/docs/admin/authorization/rbac/#aggregated-clusterroles
This patch makes kubectl could create clusterrole with aggregation rules.
**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-05-22 08:40:20 -07:00
juanvallejo d1603c9560 move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
WanLinghao 5e9e3afb2e kubectl: add aggregation rule support to clusterrole 2018-05-18 19:44:23 +08:00
David Eads 420dd9bf66 move type setting into an optional layer above normal printing 2018-05-17 17:22:12 -04:00
juanvallejo 0164605d31 remove versioned printer 2018-05-17 17:20:54 -04:00
David Eads 0db40da909 update factory interface to overlap with lower RESTClientGetter 2018-05-17 08:27:53 -04:00
ravisantoshgudimetla f3441a5c20 Update e2e to use priorityClass beta 2018-05-14 18:13:41 -04:00
Di Xu e8ef744493 fix missing flag value bindings in kubectl 2018-05-14 14:38:54 +08:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
David Eads d8924bc1c9 move old dynamic client to deprecated-client 2018-05-11 08:00:46 -04:00
Kubernetes Submit Queue 6203b621ba
Merge pull request #62244 from CaoShuFeng/raw
Automatic merge from submit-queue (batch tested with PRs 62244, 63685). 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 create --raw"

Before this change:
```
$ kubectl create -f  pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): unknown
```

After this change:
```
$ kubectl create -f pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): pods is forbidden: User "tom" cannot create pods in the namespace "default"
```

/assign @soltysh 
**Release note**:

```release-note
NONE
```
2018-05-10 16:30:07 -07: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
Kubernetes Submit Queue 4868d7775a
Merge pull request #63511 from juanvallejo/jvallejo/cmd-cleanup
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>.

cleanup TODOs from PrintFlags wiring

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

Address TODOs from PrintFlags wiring

cc @soltysh @deads2k
2018-05-10 14:25:13 -07:00
juanvallejo 40e52bf07d remove legacyscheme dep from printFlags 2018-05-10 14:51:12 -04:00