Commit fe69e2f
committed
fix(cli): use _GCLOUD_CMD for gcloud calls in GKE deploy on Windows
The GKE deploy path (`adk deploy gke`) still invoked gcloud via the bare
name `gcloud` in two places: the `builds submit` call and the
`container clusters get-credentials` call. On Windows, gcloud is the
`gcloud.cmd` batch script, and subprocess.run() without a shell does not
apply PATHEXT to a bare name, so both calls raise FileNotFoundError and
the deploy fails.
The module already defines `_GCLOUD_CMD = 'gcloud.cmd' if _IS_WINDOWS
else 'gcloud'` for exactly this reason and uses it in the Cloud Run path,
but the two GKE call sites were missed. Point them at `_GCLOUD_CMD` too.
No behavior change on POSIX.
Add a regression test that patches `_GCLOUD_CMD` to simulate Windows and
asserts both GKE gcloud invocations use `gcloud.cmd`.1 parent e6df097 commit fe69e2f
2 files changed
Lines changed: 53 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1396 | 1396 | | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | | - | |
| 1399 | + | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
| |||
1466 | 1466 | | |
1467 | 1467 | | |
1468 | 1468 | | |
1469 | | - | |
| 1469 | + | |
1470 | 1470 | | |
1471 | 1471 | | |
1472 | 1472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
445 | 496 | | |
446 | 497 | | |
447 | 498 | | |
| |||
0 commit comments