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

fix: ensure proper kubectl is used #3328

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

rjsadow
Copy link
Contributor

@rjsadow rjsadow commented Aug 11, 2023

Ensure that the kubectl built is the one used throughout the script.

ref: kubernetes/test-infra#30345

/cc @BenTheElder @aojea

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 11, 2023
@stmcginnis
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 11, 2023
@@ -73,6 +73,9 @@ build() {
fi
# make sure we have e2e requirements
make all WHAT="cmd/kubectl test/e2e/e2e.test ${GINKGO_SRC_DIR}"

# Ensure the built kubecl is used instead of system
export PATH="${PWD}/bin/kubectl:$PATH"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that works? For one thing Kubernetes doesn't build to bin/

Copy link
Contributor Author

@rjsadow rjsadow Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I was looking at the wrong dir. I think it'll need to be export PATH="${PWD}/_output/bin/kubectl:$PATH" . This is based on https://github.com/kubernetes/kubernetes/blob/master/build/root/Makefile#L45-L46 and running e2e-k8s.sh locally.

Copy link
Contributor Author

@rjsadow rjsadow Aug 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still isn't the right fix. Looking more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check in the kubernetes/hack folder, there are multiple scripts that looks for the kubectl binary there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😓 PATH="${PWD}/_output/bin/kubectl:$PATH" vs PATH="${PWD}/_output/bin:$PATH".... Too much time spent on realizing that. Update incoming.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget if we can rely on this always being the case but we can start here. When you build dockerized vs not the k8s build system emits to different subpaths under _output, but they might both be linked to this path? In the past in kubernetes upstream we've had to use a small utility to check multiple locations.

If this is working in CI we can start here though.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2023
@rjsadow rjsadow changed the title fix: ensure proper kubectl is used [wip] ensure proper kubectl is used Aug 13, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 13, 2023
@rjsadow rjsadow force-pushed the e2e-kubectl branch 6 times, most recently from 20ee665 to 82a4a01 Compare August 13, 2023 23:35
@aojea
Copy link
Contributor

aojea commented Aug 14, 2023

/test pull-kind-conformance-parallel-dual-stack-ipv4-ipv6

not related, this is because kubernetes/kubernetes#119927

This looks correct now

+ kubectl version
Client Version: v1.29.0-alpha.0.66+6e0cb243d57592
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.0-alpha.0.66+6e0cb243d57592

/assign @BenTheElder

hack/ci/e2e-k8s.sh Outdated Show resolved Hide resolved
Co-authored-by: Antonio Ojea <[email protected]>
@rjsadow rjsadow changed the title [wip] ensure proper kubectl is used fix: ensure proper kubectl is used Aug 14, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 14, 2023
@rjsadow
Copy link
Contributor Author

rjsadow commented Aug 16, 2023

/retest

Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

w/ comment about why we may need a more elaborate follow-up

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, rjsadow

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2023
@k8s-ci-robot k8s-ci-robot merged commit ad74503 into kubernetes-sigs:main Aug 22, 2023
26 checks passed
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants