Print object should be updated which may cause potential bug.

This patch fix this.
	modified:   pkg/kubectl/cmd/create_clusterrole.go
	modified:   pkg/kubectl/cmd/create_role.go
This commit is contained in:
WanLinghao 2018-03-21 15:34:50 +08:00
parent 3e5596321e
commit 83a148310d
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
}