Skip to content

Commit 13378f4

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#61462 from WanLinghao/kubectl_return_obj_fix
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). 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 print object should be updated error **What this PR does / why we need it**: Print object should be updated.   After this patch, it goes the same as create.go https://github.com/kubernetes/kubernetes/blob/025439988428d2b78342549419706639cd6e52a6/pkg/kubectl/cmd/create.go#L346 **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 ```
2 parents cc859a8 + 83a1483 commit 13378f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/kubectl/cmd/create_clusterrole.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (c *CreateClusterRoleOptions) RunCreateRole() error {
166166

167167
// Create ClusterRole.
168168
if !c.DryRun {
169-
_, err = c.Client.ClusterRoles().Create(clusterRole)
169+
clusterRole, err = c.Client.ClusterRoles().Create(clusterRole)
170170
if err != nil {
171171
return err
172172
}

pkg/kubectl/cmd/create_role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (c *CreateRoleOptions) RunCreateRole() error {
286286

287287
// Create role.
288288
if !c.DryRun {
289-
_, err = c.Client.Roles(c.Namespace).Create(role)
289+
role, err = c.Client.Roles(c.Namespace).Create(role)
290290
if err != nil {
291291
return err
292292
}

0 commit comments

Comments
 (0)