Skip to content

Commit bef584c

Browse files
committed
Record correct OperatorGroup in status
It seems like this was a typo in the original implementation - the controller correctly updates the resource to match the "merged" version, but was then using the "desired" version of the resource (which only specifies what parts the user was interested in, and does not reflect the full live state) when updating the status of the policy. The updated section in `musthaveOpGroup` now more closely matches the analogous section in `musthaveSubscription`. Signed-off-by: Justin Kulikauskas <[email protected]>
1 parent c20f555 commit bef584c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

controllers/operatorpolicy_controller.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,18 +1183,16 @@ func (r *OperatorPolicyReconciler) musthaveOpGroup(
11831183
earlyConds = append(earlyConds, calculateComplianceCondition(policy))
11841184
}
11851185

1186-
desiredOpGroup.ResourceVersion = opGroup.GetResourceVersion()
1187-
11881186
opLog.Info("Updating OperatorGroup to match desired state", "opGroupName", opGroup.GetName())
11891187

11901188
err = r.TargetClient.Update(ctx, &opGroup)
11911189
if err != nil {
11921190
return false, nil, changed, fmt.Errorf("error updating the OperatorGroup: %w", err)
11931191
}
11941192

1195-
desiredOpGroup.SetGroupVersionKind(operatorGroupGVK) // Update stripped this information
1193+
opGroup.SetGroupVersionKind(operatorGroupGVK) // Update stripped this information
11961194

1197-
updateStatus(policy, updatedCond("OperatorGroup"), updatedObj(desiredOpGroup))
1195+
updateStatus(policy, updatedCond("OperatorGroup"), updatedObj(&opGroup))
11981196

11991197
return true, earlyConds, true, nil
12001198
default:

0 commit comments

Comments
 (0)