kubebuilder
kubebuilder copied to clipboard
🌱 Improve Kind Integration: Ensure Custom Kind Binary is Used in E2E Tests
trafficstars
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 the KIND variable.
Motivation
- Consistency: The Makefile already supports a configurable Kind binary, but test utilities did not.
- Flexibility: Users running Kind from a custom location (or via a wrapper script) can now ensure it is used everywhere.
- CI/CD Compatibility: Some environments may not have
kindglobally available in$PATH.
Changes
- Updated test utilities (
test/utils/utils.go) to check for aKINDenvironment variable before defaulting to"kind". - Modified Makefile test commands to explicitly pass
KIND=$(KIND)togo test. - Applied changes across multiple test setups, including the cronjob tutorial, multiversion tutorial, and project scaffolds.
- Ensured that Kind cluster name configurability introduced earlier remains functional.
Notes
- Maintains full backward compatibility (defaults to
kindifKINDis not set). - No breaking changes.
- Further improves Kind integration by making both cluster names and binary paths configurable across all test components.