Merge pull request #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
0254399884/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
```
This commit is contained in:
Kubernetes Submit Queue 2018-03-27 09:47:15 -07:00 committed by GitHub
commit 13378f4643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -166,7 +166,7 @@ func (c *CreateClusterRoleOptions) RunCreateRole() error {
// Create ClusterRole.
if !c.DryRun {
_, err = c.Client.ClusterRoles().Create(clusterRole)
clusterRole, err = c.Client.ClusterRoles().Create(clusterRole)
if err != nil {
return err
}

View File

@ -286,7 +286,7 @@ func (c *CreateRoleOptions) RunCreateRole() error {
// Create role.
if !c.DryRun {
_, err = c.Client.Roles(c.Namespace).Create(role)
role, err = c.Client.Roles(c.Namespace).Create(role)
if err != nil {
return err
}