-
Notifications
You must be signed in to change notification settings - Fork 1.5k
🌱 Improve Kind Integration: Ensure Custom Kind Binary is Used in E2E Tests #4618
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
base: master
Are you sure you want to change the base?
🌱 Improve Kind Integration: Ensure Custom Kind Binary is Used in E2E Tests #4618
Conversation
Hi @kersten. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kersten The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
675981c
to
7be37d9
Compare
7be37d9
to
51fe16f
Compare
f2a70e7
to
c294491
Compare
/ok-to-test |
@kersten: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@camilamacedo86 could you trigger the tests? |
@@ -81,7 +81,7 @@ setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist | |||
|
|||
.PHONY: test-e2e | |||
test-e2e: setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind. | |||
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v | |||
KIND=$(KIND) KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v |
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.
It would increase the complexities.
If we would move in this direction then why not use KIND_CLUSTER
certmanagerVersion = "v1.16.3" | ||
certmanagerURLTmpl = "https://github.com/cert-manager/cert-manager/releases/download/%s/cert-manager.yaml" | ||
|
||
defaultKindBinary = "kind" |
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.
I think we should avoid handling kind directly in the e2e test code. It’s better to rely on the setup already defined in the Makefile (e.g., make e2e-setup). This keeps the tests clean and avoids adding complexity.
Developers can install kind and run the setup manually as needed. Automating this in test code feels out of scope and might limit flexibility for different environments.
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok { | ||
cluster = v | ||
} | ||
kindOptions := []string{"load", "docker-image", name, "--name", cluster} | ||
cmd := exec.Command("kind", kindOptions...) | ||
kindBinary := defaultKindBinary | ||
if v, ok := os.LookupEnv("KIND"); ok { |
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.
Why do we need an additional env var here?
We should aim to keep the code as simple as possible — adding more environment variables increases complexity without clear ROI. Unless it’s strictly necessary, it’s better to avoid introducing extra config.
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.
Hi @kersten
I added some coments see that when we change the scaffolds done by the tool we should not use 🌱 ( for those cases we need to use ✨ - new features and enhancements OR 🐛 for bug fixes )
add support for using a custom kind binary by reading from the KIND environment variable. This allows flexibility in testing environments where a different kind binary might be needed. The default behavior remains unchanged, using "kind" if no environment variable is set.
c294491
to
651ce94
Compare
Description
This PR refines the existing Kind integration by ensuring that the
KIND
environment variable is consistently used across e2e test utilities. While PR #4615 made the Kind binary configurable in the Makefile, some test scripts and utilities still relied on the default"kind"
binary directly. This change ensures that all test components respect theKIND
variable.Motivation
kind
globally available in$PATH
.Changes
test/utils/utils.go
) to check for aKIND
environment variable before defaulting to"kind"
.KIND=$(KIND)
togo test
.Notes
kind
ifKIND
is not set).