From 546d9503a51d4dfd93f21ff3fb06cbe135bfb9c2 Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Mon, 29 Apr 2024 12:11:11 -0400 Subject: [PATCH] Dynamically append startingCSV to list of allowed operator versions ref: https://issues.redhat.com/browse/ACM-11024 Signed-off-by: Jason Zhang --- controllers/operatorpolicy_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/operatorpolicy_controller.go b/controllers/operatorpolicy_controller.go index 16a99ada..90f687a9 100644 --- a/controllers/operatorpolicy_controller.go +++ b/controllers/operatorpolicy_controller.go @@ -1233,8 +1233,9 @@ func (r *OperatorPolicyReconciler) musthaveInstallPlan( } matchingCSV := len(policy.Spec.Versions) == 0 // true if `spec.versions` is not specified + allowedVersions := append(policy.Spec.Versions, policyv1.NonEmptyString(sub.Spec.StartingCSV)) - for _, acceptableCSV := range policy.Spec.Versions { + for _, acceptableCSV := range allowedVersions { if string(acceptableCSV) == ipCSVs[0] { matchingCSV = true