Skip to content
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

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

justinsb
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 19, 2022
@justinsb justinsb force-pushed the fix_kubectl_version branch 2 times, most recently from 68617ec to 1e6513c Compare December 19, 2022 18:17
@justinsb
Copy link
Contributor Author

Getting this to pass reliably probably depends on #287

@justinsb justinsb force-pushed the fix_kubectl_version branch 2 times, most recently from ff60ef0 to f9dc0fe Compare December 19, 2022 20:35
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.
@@ -144,6 +144,18 @@ metadata:
}

func TestKubectlApplier(t *testing.T) {
kubectlPath, err := exec.LookPath("kubectl")
Copy link
Contributor

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 ?

Copy link
Contributor Author

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!

@barney-s
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 11, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a56009e into kubernetes-sigs:master Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants