tilt-dev / tilt-extensions

Extensions for Tilt
https://tilt.dev/
Apache License 2.0
201 stars 159 forks source link

Fix min version issue with k8s client #521

Closed turip closed 1 year ago

turip commented 1 year ago

Context:

currently we have an error in the below with kubectl v1.28 default output is changed as same as --short flag

Error in local: command "kubectl version --short" failed.
error: exit status 1
stdout: ""
stderr: "error: unknown flag: --short\nSee 'kubectl version --help' for usage.\n"

Verified and works with kubectl v1.27 and 1.28 too.

Changes: We support both versions of k8s by trying first the normal path, and if we get the old output back (that always starts with a version.Info string), then we fall back to the old logic.

This is a less restrictive version of https://github.com/tilt-dev/tilt-extensions/pull/520 in regard the k8s version requirement.

turip commented 1 year ago

@nicks May I ask you to take a look at this? Homebrew rolled out kubectl 1.28 and without this fix people will face the same issue soon.