Commit 1fb1721
committed
fix(role): drive namespace lookup via kubectl, not kubernetes.core.k8s_info
The k8s_info module requires the optional Python 'kubernetes'
package on the controller, which is not installed in the project's
CI environment (and is not a documented prerequisite for users
either). The rest of this role already drives the cluster via
`kubectl ... --output=json` for the same reason.
Switch the cozy-system lookup to `kubectl get namespace ... \
--ignore-not-found --output=json` and parse the result with
from_json. `--ignore-not-found` returns an empty stdout (rather
than a non-zero exit) when the namespace is absent, so the same
length-check gate as before keeps the foreign-owner and adopt
tasks no-op'd on first install.
The unit tests are unchanged because they check task names and
when-clause structure, not the lookup module's internals.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>1 parent a5307cb commit 1fb1721
1 file changed
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | | - | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | | - | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| |||
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
148 | | - | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
153 | | - | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
0 commit comments