Skip to content

Commit 6043778

Browse files
rebtoorcursoragent
andcommitted
[openshift_setup] Apply CatalogSource from content-set catalog manifest
Apply cifmw_catalog_manifest so architecture-update jobs can install the OCP-aware index selected from the RHOSO content set. Related-Issue: #OSPCIX-1431 Closes: ANVIL-159 Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Roberto Alfieri <ralfieri@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 670f562 commit 6043778

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

roles/openshift_setup/tasks/configure_registries.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,65 @@
5353
spec:
5454
imageDigestMirrors: "{{ cifmw_openshift_setup_digest_mirrors }}"
5555

56+
- name: Add catalog registry credentials to cluster pull-secret
57+
when:
58+
- cifmw_catalog_manifest is defined
59+
- cifmw_catalog_manifest | length > 0
60+
- cifmw_openshift_setup_catalog_registry_credentials is defined
61+
no_log: true
62+
block:
63+
- name: Get current cluster pull-secret
64+
kubernetes.core.k8s_info:
65+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
66+
api_key: "{{ cifmw_openshift_token | default(omit) }}"
67+
context: "{{ cifmw_openshift_context | default(omit) }}"
68+
kind: Secret
69+
name: pull-secret
70+
namespace: openshift-config
71+
register: _cluster_pull_secret
72+
73+
- name: Merge catalog registry auth into cluster pull-secret
74+
vars:
75+
_current_auths: >-
76+
{{
77+
(_cluster_pull_secret.resources[0].data['.dockerconfigjson']
78+
| b64decode | from_json).auths
79+
}}
80+
_catalog_auth:
81+
"{{ cifmw_openshift_setup_catalog_registry_credentials.registry }}":
82+
auth: >-
83+
{{
84+
(cifmw_openshift_setup_catalog_registry_credentials.username ~ ':'
85+
~ cifmw_openshift_setup_catalog_registry_credentials.password)
86+
| b64encode
87+
}}
88+
_merged:
89+
auths: "{{ _current_auths | combine(_catalog_auth) }}"
90+
kubernetes.core.k8s:
91+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
92+
api_key: "{{ cifmw_openshift_token | default(omit) }}"
93+
context: "{{ cifmw_openshift_context | default(omit) }}"
94+
state: present
95+
definition:
96+
apiVersion: v1
97+
kind: Secret
98+
metadata:
99+
name: pull-secret
100+
namespace: openshift-config
101+
type: kubernetes.io/dockerconfigjson
102+
data:
103+
.dockerconfigjson: "{{ _merged | to_json | b64encode }}"
104+
105+
- name: Create CatalogSource for OpenStack operators
106+
when:
107+
- cifmw_catalog_manifest is defined
108+
- cifmw_catalog_manifest | length > 0
109+
kubernetes.core.k8s:
110+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
111+
api_key: "{{ cifmw_openshift_token | default(omit)}}"
112+
context: "{{ cifmw_openshift_context | default(omit)}}"
113+
definition: "{{ cifmw_catalog_manifest }}"
114+
56115
# If both ImageDigestMirrorSet and ImageTagMirrorSet are applied to the registries,
57116
# ITMS acts as a fallback for tag-based pulls, while IDMS provides the primary
58117
# secure source for digests

0 commit comments

Comments
 (0)