-
Notifications
You must be signed in to change notification settings - Fork 532
make: dynamically set Kubernetes and Gateway API versions for tests #11519
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: MayorFaj <[email protected]>
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.
Pull Request Overview
This PR enhances the Makefile by replacing hardcoded Kubernetes and Gateway API versions with dynamic lookups, reducing manual maintenance.
- Extracts the Kubernetes version for
envtest
from theclient-go
module. - Pulls the Gateway API version for conformance tests directly from the
sigs.k8s.io/gateway-api
module.
…go.mod Signed-off-by: MayorFaj <[email protected]>
…rkflow Signed-off-by: MayorFaj <[email protected]>
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.
Thanks for opening this. A couple of quick comments.
.github/workflows/pr-unit-tests.yaml
Outdated
- name: Install setup-envtest | ||
run: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest |
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.
This shouldn't be necessary - we already register the setup-envtest tool as a Go tool dependency: https://github.com/kgateway-dev/kgateway/blob/main/go.mod#L637.
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.
so I ran into this error earlier
make envtest-path
unable to fetch checksum for requested version: unable fetch metadata for kubebuilder-tools-1.33.0-darwin-amd64.tar.gz -- got status "404 Not Found" from GCS
go tool setup-envtest list --os linux --arch amd64
(available) v1.30.0 linux/amd64
(available) v1.29.3 linux/amd64
(available) v1.29.1 linux/amd64
What I found, The setup-envtest tool is missing binaries for recent Kubernetes versions:
❌ 1.31.0 - Missing
❌ 1.32.0 - Missing
❌ 1.33.0 - Missing
✅ 1.30.0 - Available (latest working)
We probably need to add the latest tag?
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.
Ah, yep that makes more sense. Looking at our go.mod, we can see the version of that tool is very stale:
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20231019135941-15d792835235 // indirect
We'll need to bump that tool to something more recent. You can do that by running the following command:
go get -u sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
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.
there are dependency versions mismatch that are incompatible with each other, after running the - go get. the lint test is failing
Signed-off-by: MayorFaj <[email protected]>
This pull request introduces changes to improve dependency management and ensure dynamic synchronization with external dependencies in the project's workflows and Makefile. The most important changes focus on automating version detection for tools and dependencies, enhancing maintainability, and reducing manual updates.
Dependency Management Improvements:
.github/workflows/pr-unit-tests.yaml
: Added a step to installsetup-envtest
in the unit test workflow, ensuring the necessary tool is available for testing Kubernetes environments.Makefile
: UpdatedENVTEST_K8S_VERSION
to dynamically determine the Kubernetes version based on theclient-go
dependency, and modified theENVTEST
variable to reference the installedsetup-envtest
binary path. This eliminates hardcoded versions and ensures compatibility with the project's dependencies.Synchronization with External Dependencies:
Makefile
: UpdatedCONFORMANCE_VERSION
to dynamically determine the Gateway API version fromgo.mod
. This ensures that conformance tests automatically stay in sync with the project's Gateway API dependency, reducing the need for manual updates.Change Type
Changelog
closed #11500