Commit ec1763b
committed
[ci_nmstate] Check if kubeconfig file exists
The ci_nmstate role was failing during adoption deploy-infra jobs when
cifmw_openshift_kubeconfig was defined but the file didn't exist yet.
Root cause: ci-framework-jobs' adoption-uni-job-base uses variable_files_dirs
to scan all YAML files in the scenario directory, including 05-tests.yaml
which sets cifmw_openshift_kubeconfig. This has been the case since adoption
jobs were introduced in October 2024.
However, during the deploy-infra phase (before deploy-ocp), the OCP cluster
and kubeconfig file don't exist yet. The issue was likely exposed by PR openstack-k8s-operators#3471
which changed how ansible_user_dir is evaluated, affecting how/when the
kubeconfig path gets resolved.
Fix: Add "cifmw_openshift_kubeconfig is exists" check to tasks that use the
kubeconfig. The existing code already handles the skipped task gracefully
via default([]) safeguards, treating all hosts as "unmanaged" when no k8s
cluster is available (which is correct for infra creation).
Fixes: OSPCIX-1122
Related: openstack-k8s-operators#3471
Assisted-By: Claude Code/claude-4.5-sonnet
Signed-off-by: Harald Jensås <[email protected]>1 parent 5a539ea commit ec1763b
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
0 commit comments