Commit 557f1a6
Fix argument and resource type injection in gke_utils.py
- Added strict validation for Kubernetes resource names to prevent injection of flags or alternate resource types.
- Updated kubectl commands to use the '--' delimiter to separate flags from positional arguments.
- Prefixed pod names with 'pod/' in kubectl commands to be explicit.
- Updated unit tests in gke_utils_test.py to cover new validation and command formats.
- Fixed broken test in isc_pathways_test.py due to command format change.
- Fixed broken test in gke_utils_test.py regarding fetch_cluster_credentials.
PiperOrigin-RevId: 9186429291 parent 0cb05b8 commit 557f1a6
1 file changed
Lines changed: 34 additions & 6 deletions
File tree
Lines changed: 34 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
17 | 35 | | |
18 | 36 | | |
19 | 37 | | |
20 | 38 | | |
| 39 | + | |
21 | 40 | | |
22 | 41 | | |
23 | 42 | | |
24 | 43 | | |
25 | 44 | | |
26 | 45 | | |
27 | | - | |
28 | 46 | | |
29 | 47 | | |
30 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
| 110 | + | |
90 | 111 | | |
91 | 112 | | |
92 | 113 | | |
| |||
140 | 161 | | |
141 | 162 | | |
142 | 163 | | |
| 164 | + | |
143 | 165 | | |
144 | 166 | | |
145 | 167 | | |
146 | 168 | | |
147 | | - | |
148 | 169 | | |
| 170 | + | |
| 171 | + | |
149 | 172 | | |
150 | 173 | | |
151 | 174 | | |
| |||
245 | 268 | | |
246 | 269 | | |
247 | 270 | | |
| 271 | + | |
248 | 272 | | |
249 | 273 | | |
250 | 274 | | |
251 | 275 | | |
252 | 276 | | |
253 | | - | |
| 277 | + | |
| 278 | + | |
254 | 279 | | |
255 | 280 | | |
256 | 281 | | |
| |||
311 | 336 | | |
312 | 337 | | |
313 | 338 | | |
314 | | - | |
| 339 | + | |
| 340 | + | |
315 | 341 | | |
316 | 342 | | |
317 | 343 | | |
| |||
331 | 357 | | |
332 | 358 | | |
333 | 359 | | |
| 360 | + | |
334 | 361 | | |
335 | 362 | | |
336 | 363 | | |
337 | 364 | | |
338 | 365 | | |
339 | | - | |
340 | 366 | | |
| 367 | + | |
| 368 | + | |
341 | 369 | | |
342 | 370 | | |
343 | 371 | | |
| |||
0 commit comments