@@ -1147,16 +1147,11 @@ func (o *Operator) ExecutePlan(plan *v1alpha1.InstallPlan) error {
1147
1147
return errorwrap .Wrapf (err , "error parsing step manifest: %s" , step .Resource .Name )
1148
1148
}
1149
1149
1150
- // Update UIDs on all CSV OwnerReferences
1151
- updated , err := o .getUpdatedOwnerReferences (cr .OwnerReferences , plan .Namespace )
1152
- if err != nil {
1153
- return errorwrap .Wrapf (err , "error generating ownerrefs for clusterrole %s" , cr .GetName ())
1154
- }
1155
- cr .OwnerReferences = updated
1156
-
1157
1150
// Attempt to create the ClusterRole.
1158
1151
_ , err = o .opClient .KubernetesInterface ().RbacV1 ().ClusterRoles ().Create (& cr )
1159
1152
if k8serrors .IsAlreadyExists (err ) {
1153
+ // if we're updating, point owner to the newest csv
1154
+ cr .Labels [ownerutil .OwnerKey ] = step .Resolving
1160
1155
_ , err = o .opClient .UpdateClusterRole (& cr )
1161
1156
if err != nil {
1162
1157
return errorwrap .Wrapf (err , "error updating clusterrole %s" , cr .GetName ())
@@ -1177,17 +1172,11 @@ func (o *Operator) ExecutePlan(plan *v1alpha1.InstallPlan) error {
1177
1172
return errorwrap .Wrapf (err , "error parsing step manifest: %s" , step .Resource .Name )
1178
1173
}
1179
1174
1180
- // Update UIDs on all CSV OwnerReferences
1181
- updated , err := o .getUpdatedOwnerReferences (rb .OwnerReferences , plan .Namespace )
1182
- if err != nil {
1183
- return errorwrap .Wrapf (err , "error generating ownerrefs for clusterrolebinding %s" , rb .GetName ())
1184
- }
1185
- rb .OwnerReferences = updated
1186
-
1187
1175
// Attempt to create the ClusterRoleBinding.
1188
1176
_ , err = o .opClient .KubernetesInterface ().RbacV1 ().ClusterRoleBindings ().Create (& rb )
1189
1177
if k8serrors .IsAlreadyExists (err ) {
1190
- rb .SetNamespace (plan .Namespace )
1178
+ // if we're updating, point owner to the newest csv
1179
+ rb .Labels [ownerutil .OwnerKey ] = step .Resolving
1191
1180
_ , err = o .opClient .UpdateClusterRoleBinding (& rb )
1192
1181
if err != nil {
1193
1182
return errorwrap .Wrapf (err , "error updating clusterrolebinding %s" , rb .GetName ())
0 commit comments