kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

🌱 Improve Kind Integration: Ensure Custom Kind Binary is Used in E2E Tests

Open kersten opened this issue 8 months ago • 5 comments
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 kind globally available in $PATH.

Changes

  • Updated test utilities (test/utils/utils.go) to check for a KIND environment variable before defaulting to "kind".
  • Modified Makefile test commands to explicitly pass KIND=$(KIND) to go 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 kind if KIND is not set).
  • No breaking changes.
  • Further improves Kind integration by making both cluster names and binary paths configurable across all test components.

kersten avatar Mar 19 '25 07:03 kersten