<#1045 fix: surface friendly ClickException when k...
# flyte-github
a
#1045 fix: surface friendly ClickException when kubectl is missing in devbox Pull request opened by EngHabu Summary • During
flyte start devbox
, the merge-kubeconfig step calls
kubectl config view --flatten
via
subprocess.run
. When
kubectl
is not installed,
subprocess
raises
FileNotFoundError
— which is not in the existing
(PermissionError, CalledProcessError)
catch in
_merge_kubeconfig
, so it bubbles up as a raw stack trace and gets reported to Sentry. • Add
_ensure_kubectl_available()
mirroring the existing
_ensure_docker_available
pattern, and call it at the top of
_merge_kubeconfig
. Users now see an actionable install hint instead of a
FileNotFoundError
. Closes • FLYTE-SDK-C —
FileNotFoundError: [Errno 2] No such file or directory: 'kubectl'
Test plan • New
TestEnsureKubectlAvailable
cases in
tests/cli/test_devbox.py
cover missing/present kubectl and verify
_merge_kubeconfig
raises
ClickException
instead of leaking
FileNotFoundError
. • Existing devbox tests still pass. 🤖 Generated with Claude Code flyteorg/flyte-sdk