Skip to content

Commit

Permalink
🐛 ARM architecture fixes (#292)
Browse files Browse the repository at this point in the history
* Skip cleanup if client wasn't instantiated

Signed-off-by: Dale Haiducek <[email protected]>

* Set arch to amd64 for controller-gen install

The binary is only built for `amd64`

Signed-off-by: Dale Haiducek <[email protected]>

* Upgrade `yq`

Signed-off-by: Dale Haiducek <[email protected]>

---------

Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek authored Oct 23, 2023
1 parent d7736a1 commit 6ec504f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions hack/update-v1beta1-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CONTROLLER_GEN_VERSION=v0.6.0
CONTROLLER_GEN=_output/bin/controller-gen-$CONTROLLER_GEN_VERSION
controller_gen_dir=$(dirname $CONTROLLER_GEN)
GOHOSTOS=$(go env GOHOSTOS)
GOHOSTARCH=$(go env GOHOSTARCH)
GOHOSTARCH=amd64

if ! which $CONTROLLER_GEN > /dev/null;
then echo "Installing controller-gen ...";
Expand All @@ -20,4 +20,3 @@ $CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./work/v1" 'output:
# Because the ClusterClaim CRD is stable now, we can comment out the following line.
# Uncomment to generate ClusterClaim CRD when cluster/v1alpha1/types.go is changed
# $CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./cluster/v1alpha1" 'output:dir="./crdsv1beta1"'

6 changes: 3 additions & 3 deletions hack/verify-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ ! -f ./_output/tools/bin/yq ]; then
mkdir -p ./_output/tools/bin
curl -s -f -L https://github.com/mikefarah/yq/releases/download/2.4.0/yq_$(go env GOHOSTOS)_$(go env GOHOSTARCH) -o ./_output/tools/bin/yq
curl -s -f -L https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_$(go env GOHOSTOS)_$(go env GOHOSTARCH) -o ./_output/tools/bin/yq
chmod +x ./_output/tools/bin/yq
fi

Expand All @@ -19,12 +19,12 @@ addon/v1alpha1/*.crd.yaml
FAILS=false
for f in $FILES
do
if [[ $(./_output/tools/bin/yq r $f spec.validation.openAPIV3Schema.properties.metadata.description) != "null" ]]; then
if [[ $(./_output/tools/bin/yq .spec.validation.openAPIV3Schema.properties.metadata.description $f) != "null" ]]; then
echo "Error: cannot have a metadata description in $f"
FAILS=true
fi

if [[ $(./_output/tools/bin/yq r $f spec.preserveUnknownFields) != "false" ]]; then
if [[ $(./_output/tools/bin/yq .spec.preserveUnknownFields $f) != "false" ]]; then
echo "Error: pruning not enabled (spec.preserveUnknownFields != false) in $f"
FAILS=true
fi
Expand Down
2 changes: 1 addition & 1 deletion test/integration-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export KUBEBUILDER_ASSETS ?=$(TEST_TMP)/kubebuilder/bin

K8S_VERSION ?=1.23.1
GOHOSTOS ?=$(shell go env GOHOSTOS)
GOHOSTARCH ?=$(shell go env GOHOSTARCH)
GOHOSTARCH =amd64
KB_TOOLS_ARCHIVE_NAME :=kubebuilder-tools-$(K8S_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz
KB_TOOLS_ARCHIVE_PATH := $(TEST_TMP)/$(KB_TOOLS_ARCHIVE_NAME)

Expand Down
15 changes: 9 additions & 6 deletions test/integration/api/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ var _ = ginkgo.BeforeSuite(func(done ginkgo.Done) {
var _ = ginkgo.AfterSuite(func() {
ginkgo.By("tearing down the test environment")

err := kubernetesClient.CoreV1().Namespaces().
Delete(context.TODO(), testNamespace, metav1.DeleteOptions{})
gomega.Expect(err).ToNot(gomega.HaveOccurred())

err = testEnv.Stop()
gomega.Expect(err).ToNot(gomega.HaveOccurred())
// Skip if client wasn't instantiated
if kubernetesClient != nil {
err := kubernetesClient.CoreV1().Namespaces().
Delete(context.TODO(), testNamespace, metav1.DeleteOptions{})
gomega.Expect(err).ToNot(gomega.HaveOccurred())

err = testEnv.Stop()
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
})

0 comments on commit 6ec504f

Please sign in to comment.