Fix go error in package_prerequisite step 60/4460/3
authorTodd Malsbary <todd.malsbary@intel.com>
Fri, 24 Sep 2021 22:25:29 +0000 (15:25 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Mon, 4 Oct 2021 23:51:16 +0000 (16:51 -0700)
The common.sh file is sourced before go is installed and it wants to
execute go env.  Defer the execution until after go is installed.

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I53063c60eb6140eeb79b7567ac3585ca477ce3fd

deploy/metal3/scripts/01_metal3.sh
env/lib/common.sh

index 9a8f079..77597db 100755 (executable)
@@ -12,6 +12,11 @@ if [[ $EUID -ne 0 ]]; then
     exit 1
 fi
 
+#Path to clone the metal3 dev env repo
+M3PATH="$(go env GOPATH)/src/github.com/metal3-io"
+#Path to clone the baremetal operator repo
+BMOPATH="${M3PATH}/baremetal-operator"
+
 IMAGE_URL=http://172.22.0.1/images/${BM_IMAGE}
 IMAGE_CHECKSUM=http://172.22.0.1/images/${BM_IMAGE}.md5sum
 
index aa8a1e9..9ac1431 100755 (executable)
@@ -18,10 +18,6 @@ IRONIC_PROVISIONING_INTERFACE_IP=${IRONIC_PROVISIONING_INTERFACE_IP:-"172.22.0.1
 BM_IMAGE_URL=${BM_IMAGE_URL:-"https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"}
 BM_IMAGE=${BM_IMAGE:-"bionic-server-cloudimg-amd64.img"}
 
-#Path to clone the metal3 dev env repo
-M3PATH="$(go env GOPATH)/src/github.com/metal3-io"
-#Path to clone the baremetal operator repo
-BMOPATH="${M3PATH}/baremetal-operator"
 #Baremetal operator repository URL
 BMOREPO="${BMOREPO:-https://github.com/metal3-io/baremetal-operator.git}"
 #Baremetal operator repository branch to checkout