Skip to content

Commit 4340830

Browse files
committed
fix: Use the console url to caluclate the fqdn of spoke clusters
This is needed, because when the spoke cluster is a hcp managed cluster the managedClusterClientConfigs url is the url of the aws loadbalancer and not the true clusterDomain, and the spoke golang external secret ClusterSecretStore fails to connect to the vault.
1 parent c7cf17c commit 4340830

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

roles/vault_utils/tasks/vault_spokes_init.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@
3737
ansible.builtin.set_fact:
3838
clusters: "{{ clusters | default({}) | combine({item.metadata.name:
3939
{'server_api': item.spec.managedClusterClientConfigs[0].url,
40-
'cluster_fqdn': item.spec.managedClusterClientConfigs[0].url | ansible.builtin.urlsplit('hostname') | regex_replace('^api\\.', '')}}, recursive=True) }}"
40+
'cluster_fqdn':_cluster_fqdn }}, recursive=True) }}"
4141
loop: "{{ resources }}"
42+
vars:
43+
_cluster_fqdn: "{{ item.status.clusterClaims | selectattr('name', 'equalto', 'consoleurl.cluster.open-cluster-management.io')
44+
| map(attribute='value')
45+
| first | ansible.builtin.urlsplit('hostname') | regex_replace('console-openshift-console\\.apps\\.', '') }}"
4246
when: item.spec.managedClusterClientConfigs[0].url is defined
4347
loop_control:
4448
label: "{{ item.metadata.name }}"

0 commit comments

Comments
 (0)