Skip to content

Commit 592d089

Browse files
[cifmw_helpers] Fix CRC certificate renewal wait using kubeconfig
The oc login command in crc_start.yml was missing the -p (password) flag, causing every retry to fail with 401 Unauthorized regardless of cluster health. This code path was never exercised until ~2026-06-03 when the CRC image certificates expired, breaking all CRC-based molecule jobs. Replace oc login with oc get nodes using the CRC kubeconfig file. This avoids the OAuth dependency during certificate renewal and does not require credentials. Also increase retries from 90 to 150 (~25 minutes) to cover the observed recovery time. Signed-off-by: Vito Castellano <vcastell@redhat.com>
1 parent 3bcd0bf commit 592d089

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

roles/cifmw_helpers/tasks/crc_start.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
register: _crc_output
77
ignore_errors: true # noqa: ignore-errors
88

9-
- name: Login to the OpenShift when certificate is expired
9+
- name: Wait for cluster to stabilize after certificate renewal
1010
when: "'Kubelet serving certificate has expired' in _crc_output.stderr"
1111
ansible.builtin.command: >
12-
oc login
13-
-u kubeadmin
14-
https://api.crc.testing:6443
15-
--insecure-skip-tls-verify
16-
register: _openshift_login
17-
until: _openshift_login.rc == 0
18-
retries: 90
12+
oc get nodes
13+
--kubeconfig={{ ansible_user_dir }}/.crc/machines/crc/kubeconfig
14+
register: _cluster_check
15+
until: _cluster_check.rc == 0
16+
retries: 150
1917
delay: 10
2018
changed_when: false

0 commit comments

Comments
 (0)