Merge pull request #56252 from deads2k/rbac-04-migrate

Automatic merge from submit-queue (batch tested with PRs 56249, 56118, 56255, 56252, 56256). 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>.

clear resourceversion for migrated cluster roles

Fixes #56248

Need to clear the resource version.  Alternatively, we could clear it in storage when we clear and stomp other fields.

Works locally for me.
This commit is contained in:
Kubernetes Submit Queue 2017-11-23 00:23:26 -08:00 committed by GitHub
commit 2db7c41cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,6 +343,7 @@ func primeAggregatedClusterRoles(clusterRolesToAggregate map[string]string, clus
}
glog.V(1).Infof("migrating %v to %v", existingRole.Name, newName)
existingRole.Name = newName
existingRole.ResourceVersion = "" // clear this so the object can be created.
if _, err := clusterRoleClient.ClusterRoles().Create(existingRole); err != nil && !apierrors.IsAlreadyExists(err) {
return err
}