Commit b3a2732
fix: surface devbox docker/kubeconfig errors as ClickException (#1041)
## Summary
- Wrap the docker volume/ps subprocess calls in `_devbox.py` with a
small `_run_docker` helper that converts non-zero exits into
`click.ClickException` with stderr details, instead of bubbling raw
`CalledProcessError` up the stack.
- Use `unlink(missing_ok=True)` and translate `PermissionError` on the
stale k3s kubeconfig into an actionable `ClickException`.
## Closes
- [FLYTE-SDK-D](https://unionai.sentry.io/issues/FLYTE-SDK-D) — `docker
volume ls` non-zero exit reported as raw subprocess crash
- [FLYTE-SDK-1H](https://unionai.sentry.io/issues/FLYTE-SDK-1H) —
`PermissionError` unlinking `/tmp/.kube/kubeconfig`
## Test plan
- [x] New unit tests in `tests/cli/test_devbox.py` cover the failure
paths for `_ensure_volume`, `_container_is_running`,
`_container_is_paused`.
- [x] Existing devbox tests still pass.
- [ ] Manual: \`flyte start devbox\` with docker stopped → friendly
message; with a root-owned `/tmp/.kube/kubeconfig` → friendly message.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d2b9006 commit b3a2732
2 files changed
Lines changed: 62 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | | - | |
| 49 | + | |
41 | 50 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
51 | | - | |
| 61 | + | |
52 | 62 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
61 | | - | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| |||
258 | 264 | | |
259 | 265 | | |
260 | 266 | | |
261 | | - | |
262 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
263 | 274 | | |
264 | 275 | | |
265 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
0 commit comments