kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue a2931c6218 Merge pull request #40289 from xilabao/fix-save-config-in-create-subcommand
Automatic merge from submit-queue

fix --save-config in create subcommand

--save-config option doesn't work.
```
#kubectl create rolebinding a --role=b --user=c --save-config  
rolebinding "a" created
```
old output:
```
#kubectl get rolebinding a -o yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  creationTimestamp: 2017-01-23T10:09:48Z
  name: a
  namespace: default
  resourceVersion: "281"
  selfLink: /apis/rbac.authorization.k8s.io/v1beta1/namespaces/default/rolebindings/a
  uid: 12abccd6-e154-11e6-819c-525400f84377
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: b
subjects:
- apiVersion: rbac/v1alpha1
  kind: User
  name: c
```

expected output:
```
#kubectl get rolebinding a -o yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"kind":"RoleBinding","apiVersion":"rbac.authorization.k8s.io/v1beta1","metadata":{"name":"c","creationTimestamp":null},"subjects":[{"kind":"User","apiVersion":"rbac/v1alpha1","name":"c"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"Role","name":"b"}}
  creationTimestamp: 2017-01-23T10:09:48Z
  name: a
  namespace: default
  resourceVersion: "281"
  selfLink: /apis/rbac.authorization.k8s.io/v1beta1/namespaces/default/rolebindings/a
  uid: 12abccd6-e154-11e6-819c-525400f84377
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: b
subjects:
- apiVersion: rbac/v1alpha1
  kind: User
  name: c
```
2017-02-04 04:40:29 -08:00
..
config Update generated files 2017-01-29 21:41:45 +01:00
rollout generated changes 2017-01-17 08:32:05 -05:00
set Extract strings for the 'kubectl set' family of commands. 2017-01-29 14:46:07 -08:00
templates Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
testing fixup apply null tests 2017-01-31 15:00:23 -05:00
util Removed HPA objects from extensions api group 2017-02-02 14:09:54 +01:00
annotate_test.go annotate: use unstructured objects 2017-01-26 19:59:24 -05:00
annotate.go annotate: use unstructured objects 2017-01-26 19:59:24 -05:00
apiversions.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
apply_test.go fixup apply null tests 2017-01-31 15:00:23 -05:00
apply.go apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK 2017-02-02 15:19:50 -08:00
attach_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
attach.go find and replace 2017-01-20 08:04:53 -05:00
autoscale.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
BUILD apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK 2017-02-02 15:19:50 -08:00
certificates.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
clusterinfo_dump_test.go Move the common test functions from cmd_test.go to cmd/testing/fake.go 2016-10-19 08:53:26 +10:00
clusterinfo_dump.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
clusterinfo.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
cmd_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
cmd.go pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
completion.go Allow setting copyright header file for generated completions 2017-01-19 16:06:20 +01:00
convert.go mechanical repercussions 2017-01-13 08:27:14 -05:00
cp_test.go add kubectl cp 2016-10-29 20:24:54 -07:00
cp.go add kubectl cp 2016-10-29 20:24:54 -07:00
create_clusterrolebinding.go update prompt in create rolebinding/clusterrolebinding 2016-12-22 11:33:49 +08:00
create_configmap_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_configmap.go Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
create_deployment_test.go Move the common test functions from cmd_test.go to cmd/testing/fake.go 2016-10-19 08:53:26 +10:00
create_deployment.go Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
create_namespace_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_namespace.go Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
create_pdb.go kubectl: add create pdb subcommand 2016-12-02 18:42:25 +01:00
create_quota_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_quota.go kubectl: add create pdb subcommand 2016-12-02 18:42:25 +01:00
create_rolebinding.go update prompt in create rolebinding/clusterrolebinding 2016-12-22 11:33:49 +08:00
create_secret_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_secret.go Merge pull request #35191 from SamiHiltunen/commas-in-secrets 2016-12-23 08:04:50 -08:00
create_service_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_service.go Merge pull request #34789 from AdoHe/external_service 2016-12-02 07:29:06 -08:00
create_serviceaccount_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_serviceaccount.go kubectl: add create pdb subcommand 2016-12-02 18:42:25 +01:00
create_test.go Distinguish between client and unstructuredclient in fake factory 2017-01-26 19:59:16 -05:00
create.go Merge pull request #40289 from xilabao/fix-save-config-in-create-subcommand 2017-02-04 04:40:29 -08:00
delete_test.go Test cascading delete without client-side reaper does not GET 2017-01-27 09:18:48 -05:00
delete.go refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
describe_test.go describe: use unstructured objects 2017-01-26 19:59:25 -05:00
describe.go describe: use unstructured objects 2017-01-26 19:59:25 -05:00
drain_test.go move client/record 2017-01-31 19:14:13 -05:00
drain.go refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
edit.go Merge pull request #40357 from sttts/sttts-more-cutoffs-2 2017-01-25 17:47:13 -08:00
exec_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
exec.go find and replace 2017-01-20 08:04:53 -05:00
explain.go mechanical repercussions 2017-01-13 08:27:14 -05:00
expose_test.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
expose.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
get_test.go pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality 2017-01-29 21:41:45 +01:00
get.go only output "No resources found." for human readable printers 2017-01-27 13:30:23 -05:00
help.go Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
label_test.go label: use unstructured objects 2017-01-26 19:59:25 -05:00
label.go label: use unstructured objects 2017-01-26 19:59:25 -05:00
logs_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
logs.go find and replace 2017-01-20 08:04:53 -05:00
options.go Improve kubectl help with examples. 2017-01-06 13:35:43 -08:00
patch_test.go Print resource name when patch is done 2017-01-27 14:58:52 -08:00
patch.go Print resource name when patch is done 2017-01-27 14:58:52 -08:00
portforward_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
portforward.go move portforward to client-go 2017-01-31 14:13:35 -05:00
proxy.go fix typo in kubectl proxy command line help 2016-11-29 11:54:48 +00:00
replace_test.go Distinguish between client and unstructuredclient in fake factory 2017-01-26 19:59:16 -05:00
replace.go mechanical 2017-01-16 09:35:12 -05:00
rollingupdate_test.go Move the common test functions from cmd_test.go to cmd/testing/fake.go 2016-10-19 08:53:26 +10:00
rollingupdate.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
run_test.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
run.go move dynamic and discovery clients 2017-01-26 08:37:06 -05:00
scale.go fix --record to work with unstructured objects 2017-01-26 19:59:27 -05:00
stop.go When --grace-period=0 is provided, wait for deletion 2016-11-23 15:02:43 -06:00
taint_test.go pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
taint.go forgiveness library changes 2017-01-31 21:39:17 +08:00
top_node_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
top_node.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
top_pod_test.go pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
top_pod.go refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
top_test.go pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
top.go modify the specifications 2017-01-04 09:12:24 +08:00
version.go Improve kubectl help with examples. 2017-01-06 13:35:43 -08:00