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/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)) 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 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