Skip to content

Commit

Permalink
chore: update kubebuilder toolchain and test k8sversion (aws#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
njtran authored Nov 16, 2023
1 parent 73035bb commit 91f7d0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
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

0 comments on commit 91f7d0b

Please sign in to comment.