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