Skip to content

Conversation

@yiraeChristineKim
Copy link
Contributor

@yiraeChristineKim yiraeChristineKim commented Nov 20, 2025

Description:
When the subscription section of the OperatorPolicy is invalid, the status might incorrectly indicate that other parts of the policy are invalid. This, combined with the many "... because the policy is invalid" clauses in the overall status, makes it very confusing to read and understand what parts might need to be fixed by the user.

Change summary
Refactored buildResources to simplify control flow, ensure accurate changed propagation, and improve early error reporting.
Added focused unit tests and dryrun tests; refined e2e case38 to reflect new validation behavior and to fix formatting.

Previous results:
The status message was extremely long, for example:
“NonCompliant; installPlanApproval is prohibited in spec.subscription, the namespace specified in spec.operatorGroup ('example') must match the namespace used for the subscription ('openshift-operators'), the status of the OperatorGroup could not be determined because the policy is invalid, the status of the Subscription could not be determined because the policy is invalid, the status of the InstallPlan could not be determined because the policy is invalid, a relevant installed ClusterServiceVersion could not be found, no CRDs were found for the operator, there are no relevant deployments because the ClusterServiceVersion is missing, the status of the CatalogSource could not be determined because the policy is invalid.”
After the fix:
The only meaningful part is now:
“installPlanApproval is prohibited in spec.subscription.”
Everything else was just unnecessary noise and is no longer included.
This part is actually incorrect: "the namespace specified in spec.operatorGroup ('example') must match the namespace used for the subscription ('openshift-operators'),".
Ref: https://issues.redhat.com/browse/ACM-16781

@openshift-ci
Copy link

openshift-ci bot commented Nov 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yiraeChristineKim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yiraeChristineKim
Copy link
Contributor Author

/ok-to-test

When the subscription section of the OperatorPolicy is invalid, the status might incorrectly indicate that other parts of the policy are invalid. This, combined with the many "... because the policy is invalid" clauses in the overall status, makes it very confusing to read and understand what parts might need to be fixed by the user.
Ref: https://issues.redhat.com/browse/ACM-16781
Signed-off-by: yiraeChristineKim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant