[kustomize_deploy] Fix InstallPlan approval to respect deployment version #3591
+63
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug: When deploying with cifmw_ci_gen_kustomize_values_deployment_version set and installplan_approval=Manual, the install_plan.yml task would approve ALL unapproved InstallPlans, not just the one matching the specified version. This can cause the base version and any newer versions in the bundle to be approved, preventing proper update testing scenarios.
For example, when deploying v1.0.7 to test an update to v1.0.18:
Seen when the installplans had this ordering:
Root cause: The task selected the first unapproved InstallPlan without checking if it matched the requested CSV version.
Fix: Added version filtering using spec.clusterServiceVersionNames when cifmw_ci_gen_kustomize_values_deployment_version is defined. The task now:
With the fix:
Backward compatibility: When cifmw_ci_gen_kustomize_values_deployment_version is not defined, the original behavior (approve first unapproved InstallPlan) is maintained.
Related: OSPRH-23688