Skip to content

Commit

Permalink
Add Ansible variable cifmw_openshift_setup_apply_marketplace_fix
Browse files Browse the repository at this point in the history
On some images (especially on legacy CRC images e.g. 2.30.0), there
is no need to run the openshift-marketplace workaround which is
removing all the pods from the namespace.
That step might be problematic on old deployments, due the
ImagePullPolicy is set to "Always", so after removing the
pods when the credentials are vanished, pods would be not recreated.

Signed-off-by: Daniel Pawlik <[email protected]>
  • Loading branch information
danpawlik committed Feb 7, 2025
1 parent e335338 commit b7b4f6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/openshift_setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ effect if `cifmw_openshift_setup_ca_registry_to_add` is set.
- mirror.quay.rdoproject.org
```
* `cifmw_openshift_setup_metal3_watch_all_ns`: (Boolean) Tells Metal3 BMO to watch resources out of its namespace. Defaults to `false`.
* `cifmw_openshift_setup_apply_marketplace_fix`: (Boolean) Apply openshift-marketplace workaround which is recreating all pods in the namespace. NOTE: same step is done in `base` job.
1 change: 1 addition & 0 deletions roles/openshift_setup/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ cifmw_openshift_setup_metal3_watch_all_ns: false
cifmw_openshift_setup_operator_override_catalog_name: "redhat-operators-4.17"
cifmw_openshift_setup_operator_override_catalog_namespace: "openshift-marketplace"
cifmw_openshift_setup_operator_override_catalog_image: "registry.redhat.io/redhat/redhat-operator-index:v4.17"
cifmw_openshift_setup_apply_marketplace_fix: false
4 changes: 4 additions & 0 deletions roles/openshift_setup/tasks/fix_openshift_marketplace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
# https://github.com/crc-org/crc/issues/4109#issuecomment-2042497411.
# It will be removed once https://github.com/crc-org/crc/issues/4109
# closed.
# NOTE(dpawlik): similar fix was applied in base job:
# https://review.rdoproject.org/r/plugins/gitiles/config/+/refs/heads/master/roles/prepare-crc-extracted/tasks/recreate_marketplace.yaml
# No need to re-apply same thing here.
- name: Fix OpenShift Marketplace
when:
- not cifmw_openshift_setup_dry_run
- cifmw_openshift_setup_apply_marketplace_fix
block:
- name: Delete the pods from openshift-marketplace namespace
kubernetes.core.k8s:
Expand Down

0 comments on commit b7b4f6f

Please sign in to comment.