From 8af5ff1f01ce13c28cd79521a45e4ed70530640b Mon Sep 17 00:00:00 2001 From: Drew Minnear Date: Tue, 9 Jun 2026 10:13:09 -0400 Subject: [PATCH 1/3] add annotation to pattern before uninstall --- roles/uninstall_pattern/defaults/main.yml | 6 +++++ roles/uninstall_pattern/tasks/main.yml | 29 +++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/roles/uninstall_pattern/defaults/main.yml b/roles/uninstall_pattern/defaults/main.yml index 62bd157..a699baf 100644 --- a/roles/uninstall_pattern/defaults/main.yml +++ b/roles/uninstall_pattern/defaults/main.yml @@ -5,3 +5,9 @@ uninstall_wait_timeout: | | default("3600", true) | int }} + +patterns_operator_namespace: >- + {{ + lookup("env", "PATTERNS_OPERATOR_NAMESPACE") + | default("patterns-operator", true) + }} diff --git a/roles/uninstall_pattern/tasks/main.yml b/roles/uninstall_pattern/tasks/main.yml index 6a50b35..5558fa5 100644 --- a/roles/uninstall_pattern/tasks/main.yml +++ b/roles/uninstall_pattern/tasks/main.yml @@ -4,7 +4,7 @@ api_version: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern name: "{{ pattern_name }}" - namespace: openshift-operators + namespace: "{{ patterns_operator_namespace }}" register: pattern_info - name: Check that the pattern '{{ pattern_name }}' is present on the cluster @@ -15,10 +15,25 @@ can only be run on hub clusters, where the pattern CR and patterns operator are present, in patterns with both hub and spoke components. -- name: Fetch the pods in the openshift-operators namespace +- name: Ensure prune annotation is set on pattern CR + kubernetes.core.k8s: + state: present + api_version: gitops.hybrid-cloud-patterns.io/v1alpha1 + kind: Pattern + name: "{{ pattern_name }}" + namespace: "{{ patterns_operator_namespace }}" + definition: + metadata: + annotations: + patterns.gitops.hybrid-cloud-patterns.io/prune: "true" + when: >- + (pattern_info.resources[0].metadata.annotations | default({})) + .get('patterns.gitops.hybrid-cloud-patterns.io/prune', '') != 'true' + +- name: Fetch the pods in the {{ patterns_operator_namespace }} namespace kubernetes.core.k8s_info: kind: Pod - namespace: openshift-operators + namespace: "{{ patterns_operator_namespace }}" register: pod_list - name: Find the patterns operator controller pod @@ -29,7 +44,7 @@ ansible.builtin.assert: that: patterns_operator_pod_name != '' fail_msg: | - Could not find the patterns operator controller manager pod in the 'openshift-operators' namespace. Please ensure that the patterns + Could not find the patterns operator controller manager pod in the '{{ patterns_operator_namespace }}' namespace. Please ensure that the patterns operator is currently running in your cluster. - name: Print user-friendly uninstall message @@ -40,9 +55,9 @@ only the pattern will be removed, to facilitate easy reinstall of this pattern or other patterns. This command will wait for up to {{ uninstall_wait_timeout }} seconds while the pattern is uninstalled. To view deletion progress, you can check the logs of the '{{ patterns_operator_pod_name }}' pod - pod in the 'openshift-operators' namespace with the command: + pod in the '{{ patterns_operator_namespace }}' namespace with the command: - oc logs -f --tail=50 -n openshift-operators {{ patterns_operator_pod_name }} + oc logs -f --tail=50 -n {{ patterns_operator_namespace }} {{ patterns_operator_pod_name }} - name: Delete pattern from cluster kubernetes.core.k8s: @@ -50,6 +65,6 @@ api_version: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern name: "{{ pattern_name }}" - namespace: openshift-operators + namespace: "{{ patterns_operator_namespace }}" wait: true wait_timeout: "{{ uninstall_wait_timeout }}" From 50605f2389144330eba70be2467ec776ca361c95 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 9 Jun 2026 16:20:11 +0200 Subject: [PATCH 2/3] Fix super-linter --- .github/workflows/ansible-lint.yml | 2 +- .github/workflows/ansible-sanitytest.yml | 2 +- .github/workflows/ansible-unittest.yml | 2 +- .github/workflows/jsonschema.yaml | 2 +- .github/workflows/superlinter.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 72447e5..ece2961 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/ansible-sanitytest.yml b/.github/workflows/ansible-sanitytest.yml index d2be96f..909663c 100644 --- a/.github/workflows/ansible-sanitytest.yml +++ b/.github/workflows/ansible-sanitytest.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: path: ansible_collections/rhvp/cluster_utils persist-credentials: false diff --git a/.github/workflows/ansible-unittest.yml b/.github/workflows/ansible-unittest.yml index fa9f1fd..7184531 100644 --- a/.github/workflows/ansible-unittest.yml +++ b/.github/workflows/ansible-unittest.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: path: ansible_collections/rhvp/cluster_utils persist-credentials: false diff --git a/.github/workflows/jsonschema.yaml b/.github/workflows/jsonschema.yaml index 80a3433..f1de646 100644 --- a/.github/workflows/jsonschema.yaml +++ b/.github/workflows/jsonschema.yaml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index 9492da0..02eda6f 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 From fecd61d13c98294a278ed5b17a749300accabfe9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 09:43:02 +0000 Subject: [PATCH 3/3] Bump actions/checkout from 6.0.2 to 6.0.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ansible-lint.yml | 2 +- .github/workflows/ansible-sanitytest.yml | 2 +- .github/workflows/ansible-unittest.yml | 2 +- .github/workflows/jsonschema.yaml | 2 +- .github/workflows/superlinter.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index ece2961..0f7e630 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false diff --git a/.github/workflows/ansible-sanitytest.yml b/.github/workflows/ansible-sanitytest.yml index 909663c..9c1de6f 100644 --- a/.github/workflows/ansible-sanitytest.yml +++ b/.github/workflows/ansible-sanitytest.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: path: ansible_collections/rhvp/cluster_utils persist-credentials: false diff --git a/.github/workflows/ansible-unittest.yml b/.github/workflows/ansible-unittest.yml index 7184531..2a176ec 100644 --- a/.github/workflows/ansible-unittest.yml +++ b/.github/workflows/ansible-unittest.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: path: ansible_collections/rhvp/cluster_utils persist-credentials: false diff --git a/.github/workflows/jsonschema.yaml b/.github/workflows/jsonschema.yaml index f1de646..a55b3d8 100644 --- a/.github/workflows/jsonschema.yaml +++ b/.github/workflows/jsonschema.yaml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index 02eda6f..c88cb8c 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0