X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fmetal3%2Fscripts%2F01_metal3.sh;h=ac6a80b2d58877278cfd932eb6fbfab2ef379e80;hb=289b3d43bcbaa090619d60f5ccec3beeb808f904;hp=563a92459f860815f64170d0c575fee5c9773284;hpb=b84fbfeb7c5b41bd6cf096f16ed9f7d82e800aa5;p=icn.git diff --git a/deploy/metal3/scripts/01_metal3.sh b/deploy/metal3/scripts/01_metal3.sh index 563a924..ac6a80b 100755 --- a/deploy/metal3/scripts/01_metal3.sh +++ b/deploy/metal3/scripts/01_metal3.sh @@ -59,8 +59,10 @@ EOF function deprovision_compute_node { name="$1" - kubectl patch baremetalhost $name -n metal3 --type merge \ - -p '{"spec":{"image":{"url":"","checksum":""}}}' + if kubectl get baremetalhost $name -n metal3 &>/dev/null; then + kubectl patch baremetalhost $name -n metal3 --type merge \ + -p '{"spec":{"image":{"url":"","checksum":""}}}' + fi } function set_compute_ssh_config { @@ -214,7 +216,7 @@ function make_bm_hosts { create_userdata $name $os_username $os_password apply_userdata_credential $name - go run $GOPATH/src/github.com/metal3-io/baremetal-operator/cmd/make-bm-worker/main.go \ + GO111MODULE=auto go run $GOPATH/src/github.com/metal3-io/baremetal-operator/cmd/make-bm-worker/main.go \ -address "ipmi://$ipmi_address" \ -password "$ipmi_password" \ -user "$ipmi_username" \ @@ -251,9 +253,9 @@ function remove_bm_hosts { function cleanup { while IFS=',' read -r name ipmi_username ipmi_password ipmi_address os_username os_password os_image_name; do - kubectl delete bmh $name -n metal3 - kubectl delete secrets $name-bmc-secret -n metal3 - kubectl delete secrets $name-user-data -n metal3 + kubectl delete --ignore-not-found=true bmh $name -n metal3 + kubectl delete --ignore-not-found=true secrets $name-bmc-secret -n metal3 + kubectl delete --ignore-not-found=true secrets $name-user-data -n metal3 if [ -f $name-bm-node.yaml ]; then rm -rf $name-bm-node.yaml fi