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

chore: update kubebuilder toolchain and test k8sversion #793

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions hack/toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

K8S_VERSION="${K8S_VERSION:="1.27.x"}"
K8S_VERSION="${K8S_VERSION:="1.28.x"}"
KUBEBUILDER_ASSETS="/usr/local/kubebuilder/bin"

main() {
Expand Down Expand Up @@ -33,10 +33,6 @@ kubebuilder() {
sudo mkdir -p /usr/local/kubebuilder/bin
sudo chown "${USER}" /usr/local/kubebuilder/bin
arch=$(go env GOARCH)
## Kubebuilder does not support darwin/arm64, so use amd64 through Rosetta instead
if [[ $(go env GOOS) == "darwin" ]] && [[ $(go env GOARCH) == "arm64" ]]; then
arch="amd64"
fi
ln -sf $(setup-envtest use -p path "${K8S_VERSION}" --arch="${arch}" --bin-dir="${KUBEBUILDER_ASSETS}")/* ${KUBEBUILDER_ASSETS}
find $KUBEBUILDER_ASSETS
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewEnvironment(scheme *runtime.Scheme, options ...functional.Option[Environ
ctx, cancel := context.WithCancel(context.Background())

os.Setenv(system.NamespaceEnvKey, "default")
version := version.MustParseSemantic(strings.Replace(env.WithDefaultString("K8S_VERSION", "1.24.x"), ".x", ".0", -1))
version := version.MustParseSemantic(strings.Replace(env.WithDefaultString("K8S_VERSION", "1.28.x"), ".x", ".0", -1))
environment := envtest.Environment{Scheme: scheme, CRDs: opts.crds}
if version.Minor() >= 21 {
// PodAffinityNamespaceSelector is used for label selectors in pod affinities. If the feature-gate is turned off,
Expand Down