From 7affb9289d09b777b10b7368811c0b529160102d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 3 Jul 2020 09:25:39 +0200 Subject: [PATCH] ci: display a warning when GO_ARCH is not set for image-cephcsi `make image-cephcsi` will fail when Golang is not installed. There is no strict requirement for Golang to be available, it is only used to gather the architecture of the OS where the image is built. It is possible to build the image successfully with `make image-cephcsi GOARCH=amd64`. In case Golang is not installed, GOARCH can not be detected automatically. This will cause a failure while installing Golang in the container image. Because the failure is not very clear, display a warning in the case the GO_ARCH (from ${GOARCH} in the Makefile) is not set. Signed-off-by: Niels de Vos --- deploy/cephcsi/image/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/cephcsi/image/Dockerfile b/deploy/cephcsi/image/Dockerfile index 1b75bcdb3..4255c5ff9 100644 --- a/deploy/cephcsi/image/Dockerfile +++ b/deploy/cephcsi/image/Dockerfile @@ -16,6 +16,7 @@ ARG GOROOT=/usr/local/go COPY build.env / RUN source /build.env && \ + ( test -n "${GO_ARCH}" && exit 0; echo -e "\n\nMissing GO_ARCH argument for building image, install Golang or run: make image-ceph-csi GOARCH=amd64\n\n"; exit 1 ) && \ mkdir -p ${GOROOT} && \ curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${GO_ARCH}.tar.gz | tar xzf - -C ${GOROOT} --strip-components=1