Skip to content

Commit 079d44c

Browse files
vakwetuclaude
authored andcommitted
[federation] Fix CA bundle secret name resolving to empty string
Ansible's default() filter (without boolean=True) only substitutes Undefined values, not empty strings. cifmw_custom_ca_certs_secret_name is defined as "" in defaults/main.yml, so: | default(cifmw_custom_ca_certs_secret_name | default('custom-ca-certs')) evaluated the inner default() to "" (defined, not undefined), and the outer default() then received "" instead of Undefined, leaving the secret name empty and causing the kubernetes.core.k8s task to fail with "metadata.name: Required value". Fix by passing true as the second argument to both default() calls so that falsy values (including empty strings) are also replaced. Affects hook_controlplane_config.yml and update-central-ca-bundle.yaml. Made-with: Cursor Signed-off-by: Ade Lee <alee@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0ab4633 commit 079d44c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

hooks/playbooks/skmo/update-central-ca-bundle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
_ca_bundle_secret_name: >-
3131
{{
3232
((_central_oscp_info.resources | first).spec.tls | default({})).caBundleSecretName
33-
| default(cifmw_custom_ca_certs_secret_name | default('custom-ca-certs'))
34-
| default('custom-ca-certs')
33+
| default(cifmw_custom_ca_certs_secret_name | default('custom-ca-certs', true), true)
34+
| default('custom-ca-certs', true)
3535
}}
3636
_oscp_has_ca_bundle: >-
3737
{{

roles/federation/tasks/hook_controlplane_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
_federation_ca_bundle_secret_name: >-
4949
{{
5050
((_federation_oscp_info.resources | first).spec.tls | default({})).caBundleSecretName
51-
| default(cifmw_custom_ca_certs_secret_name | default('custom-ca-certs'))
52-
| default('custom-ca-certs')
51+
| default(cifmw_custom_ca_certs_secret_name | default('custom-ca-certs', true), true)
52+
| default('custom-ca-certs', true)
5353
}}
5454
_federation_oscp_has_ca_bundle: >-
5555
{{

0 commit comments

Comments
 (0)