From 84f46c9f9b7c3491fe7580d0c433facca40dac42 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 31 May 2023 17:57:09 -0400 Subject: [PATCH 1/3] USHIFT-1298: enable cgo to support loading local libraries --- Makefile | 8 ++++---- etcd/Makefile | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 73bf88799e..5a1b9a77df 100644 --- a/Makefile +++ b/Makefile @@ -94,11 +94,11 @@ GO_BUILD_FLAGS :=-tags 'include_gcs include_oss containers_image_openpgp gssapi GO_TEST_FLAGS=$(GO_BUILD_FLAGS) GO_TEST_PACKAGES=./cmd/... ./pkg/... -all: generate-config microshift etcd +# Enable CGO when building microshift binary for access to local libraries. +# Use an environment variable to allow CI to disable when cross-compiling. +export CGO_ENABLED ?= 1 -# target "build:" defined in vendor/github.com/openshift/build-machinery-go/make/targets/golang/build.mk -# Disable CGO when building microshift binary -build: export CGO_ENABLED=0 +all: generate-config microshift etcd microshift: build diff --git a/etcd/Makefile b/etcd/Makefile index 81a31a698c..bd28c15a6a 100644 --- a/etcd/Makefile +++ b/etcd/Makefile @@ -4,9 +4,9 @@ include ./vendor/github.com/openshift/build-machinery-go/make/targets/openshift/ OUTPUT_DIR := ../_output GO_BUILD_BINDIR := $(OUTPUT_DIR)/bin -all: export CGO_ENABLED=0 - -build: export CGO_ENABLED=0 +# Enable CGO when building microshift binary for access to local libraries. +# Use an environment variable to allow CI to disable when cross-compiling. +export CGO_ENABLED ?= 1 vendor: go mod vendor From 60769068c9543baf23ac78490152c33be30e6857 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 5 Jun 2023 14:21:40 -0400 Subject: [PATCH 2/3] run test scripts with bash explicitly chmod fails in CI, so run test scripts via bash explicitly --- e2e/main.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/e2e/main.sh b/e2e/main.sh index 8f32bc7da8..8a5552bfb5 100755 --- a/e2e/main.sh +++ b/e2e/main.sh @@ -153,12 +153,10 @@ run_test() { konfig=$(microshift_get_konfig) trap 'rm -f "${konfig}"' RETURN - - chmod +x "${SCRIPT_DIR}/tests/${test}" test_start=$(date +%s) set +e - KUBECONFIG="${konfig}" "${SCRIPT_DIR}/tests/${test}" &>"${output}/0010-test.log" + KUBECONFIG="${konfig}" bash "${SCRIPT_DIR}/tests/${test}" &>"${output}/0010-test.log" res=$? set -e test_dur=$(($(date +%s) - test_start)) From 270b2de092015ca9908c2d26c9234b8a52f89585 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 5 Jun 2023 16:54:44 -0400 Subject: [PATCH 3/3] fix pvc name in resize test --- e2e/tests/0050-pvc-resize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/tests/0050-pvc-resize.sh b/e2e/tests/0050-pvc-resize.sh index 5072fdb9ee..7956586aaf 100644 --- a/e2e/tests/0050-pvc-resize.sh +++ b/e2e/tests/0050-pvc-resize.sh @@ -28,5 +28,5 @@ oc wait --for=condition=Ready --timeout=120s pod/test-pod RESIZE_TO=2Gi TIME_OUT=3m -oc patch pvc my-pvc -p '{"spec":{"resources":{"requests":{"storage":"'${RESIZE_TO}'"}}}}' -oc wait --timeout ${TIME_OUT} --for=jsonpath="{.spec.resources.requests.storage}"=${RESIZE_TO} pvc/my-pvc \ No newline at end of file +oc patch pvc test-claim -p '{"spec":{"resources":{"requests":{"storage":"'${RESIZE_TO}'"}}}}' +oc wait --timeout ${TIME_OUT} --for=jsonpath="{.spec.resources.requests.storage}"=${RESIZE_TO} pvc/test-claim