X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fmetal3%2Fscripts%2F01_metal3.sh;h=75719e33525bebeb9ec7e97b31081236a4733640;hb=71033a920680e2495f14948c347e99ed2558f6d7;hp=6e6a1e9908e4db7397484dcdd39b4d5c845d7b68;hpb=8206d92d9942d980c6280c39f4d4ef7b0b24a898;p=icn.git diff --git a/deploy/metal3/scripts/01_metal3.sh b/deploy/metal3/scripts/01_metal3.sh index 6e6a1e9..75719e3 100755 --- a/deploy/metal3/scripts/01_metal3.sh +++ b/deploy/metal3/scripts/01_metal3.sh @@ -99,10 +99,28 @@ function launch_baremetal_operator { fi pushd $GOPATH/src/github.com/metal3-io/baremetal-operator + docker pull quay.io/metal3-io/baremetal-operator:master make deploy popd } +function remove_baremetal_operator { + if [ ! -d $GOPATH/src/github.com/metal3-io/baremetal-operator ]; then + go get github.com/metal3-io/baremetal-operator + git checkout 3d40caa29dce82878d83aeb7f8dab4dc4a856160 + fi + + pushd $GOPATH/src/github.com/metal3-io/baremetal-operator + kubectl delete -f deploy/operator.yaml -n metal3 + kubectl delete -f deploy/crds/metal3_v1alpha1_baremetalhost_crd.yaml + kubectl delete -f deploy/role_binding.yaml + kubectl delete -f deploy/role.yaml -n metal3 + kubectl delete -f deploy/service_account.yaml -n metal3 + kubectl delete ns metal3 + docker rmi quay.io/metal3-io/baremetal-operator:master + popd +} + function network_config_files { cat << 'EOF' write_files: @@ -230,11 +248,17 @@ if [ "$1" == "clean" ]; then exit 0 fi +if [ "$1" == "remove" ]; then + remove_baremetal_operator + exit 0 +fi + echo "Usage: metal3.sh" echo "launch - Launch the metal3 operator" echo "provision - provision baremetal node as specified in common.sh" echo "deprovision - deprovision baremetal node as specified in common.sh" -echo "clean - clean all the resources" +echo "clean - clean all the bmh resources" +echo "remove - remove baremetal operator" exit 1 #Following code is tested for the offline mode