-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: run with a known version of kubectl #289
tests: run with a known version of kubectl #289
Conversation
68617ec
to
1e6513c
Compare
Getting this to pass reliably probably depends on #287 |
ff60ef0
to
f9dc0fe
Compare
Update hack/ci/test.sh to download kubectl and add it to the path. Add dev/update-golden to generate golden output with the kubectl version. We run with kubectl 1.26 so that we get the fast-discovery, as this is expected to roll out more generally over the next few months.
f9dc0fe
to
59f1e09
Compare
@@ -144,6 +144,18 @@ metadata: | |||
} | |||
|
|||
func TestKubectlApplier(t *testing.T) { | |||
kubectlPath, err := exec.LookPath("kubectl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this prefer ./bin over standard paths ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if ./bin
is set in the PATH, which we do here :-)
The goal here is primarily to give a nice error if kubectl isn't on the path, but also to print the path to kubectl and the version we found, so that if something weird happens that looks like a kubectl version issue we can figure out what the problem is from the logs!
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: barney-s, justinsb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Update hack/ci/test.sh to download kubectl and add it to the path.
Add dev/update-golden to generate golden output with the kubectl version.
We run with kubectl 1.26 so that we get the fast-discovery, as this is
expected to roll out more generally over the next few months.