Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WaitForKubeAPIServerCertRenewal helper
During 4.17.0-ec.1 testing we found out that it might be possible that kubelet certs are not expired but aggreator one is and due to that our apiserver not able to get the node info and fails with following error. ``` INFO Verifying validity of the kubelet certificates... DEBU Running SSH command: date --date="$(sudo openssl x509 -in /var/lib/kubelet/pki/kubelet-client-current.pem -noout -enddate | cut -d= -f 2)" --iso-8601=seconds DEBU SSH command results: err: <nil>, output: 2025-07-05T03:48:39+00:00 DEBU Running SSH command: date --date="$(sudo openssl x509 -in /var/lib/kubelet/pki/kubelet-server-current.pem -noout -enddate | cut -d= -f 2)" --iso-8601=seconds DEBU SSH command results: err: <nil>, output: 2025-07-05T03:49:24+00:00 DEBU Running SSH command: date --date="$(sudo openssl x509 -in /etc/kubernetes/static-pod-resources/kube-apiserver-certs/configmaps/aggregator-client-ca/ca-bundle.crt -noout -enddate | cut -d= -f 2)" --iso-8601=seconds DEBU SSH command results: err: <nil>, output: 2024-07-11T05:50:37+00:00 DEBU Certs have expired, they were valid till: 11 Jul 24 05:50 +0000 DEBU Running SSH command: timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig DEBU SSH command results: err: Process exited with status 1, output: DEBU E0722 10:21:40.601631 10967 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2024-07-22T10:21:40Z is after 2024-07-10T05:27:06Z E0722 10:21:40.604575 10967 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2024-07-22T10:21:40Z is after 2024-07-10T05:27:06Z ``` This PR make sure we also wait to recover the api server related certs before checking the apiserver is responding.
- Loading branch information