@@ -23,9 +23,8 @@ GCP_ZONE=${GCP_ZONE:-"us-east4-a"}
23
23
GCP_MACHINE_MIN_CPU_PLATFORM=${GCP_MACHINE_MIN_CPU_PLATFORM:- " Intel Cascade Lake" }
24
24
GCP_MACHINE_TYPE=${GCP_MACHINE_TYPE:- " n2-standard-8" }
25
25
GCP_NETWORK_NAME=${GCP_NETWORK_NAME:- " ${CLUSTER_NAME} -mynetwork" }
26
- # Flavors are default or preinstalled:
26
+ # Flavor options are: default
27
27
# * default: installs devstack via cloud-init, OPENSTACK_RELEASE only works on default
28
- # * preinstalled: uses a already installed devstack
29
28
FLAVOR=${FLAVOR:= " default" }
30
29
PRIVATE_IP=" 10.0.2.15"
31
30
@@ -90,7 +89,8 @@ main() {
90
89
init_networks
91
90
fi
92
91
93
- if [[ ${FLAVOR} = " default" ]]; then
92
+ case " ${FLAVOR} " in
93
+ " default" )
94
94
if ! gcloud compute disks describe devstack-${FLAVOR} --zone " ${GCP_ZONE} " > /dev/null 2>&1 ;
95
95
then
96
96
gcloud compute disks create devstack-${FLAVOR} \
@@ -104,14 +104,12 @@ main() {
104
104
--source-disk devstack-${FLAVOR} --source-disk-zone " ${GCP_ZONE} " \
105
105
--licenses " https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
106
106
fi
107
- elif [[ ${FLAVOR} = " preinstalled" ]]; then
108
- if ! gcloud compute images describe devstack-${FLAVOR} > /dev/null 2>&1 ;
109
- then
110
- gcloud compute images create devstack-${FLAVOR} \
111
- --source-uri gs://artifacts.k8s-staging-capi-openstack.appspot.com/test/devstack/2021-03-28/devstack.raw.tar.gz \
112
- --licenses " https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
113
- fi
114
- fi
107
+ ;;
108
+ * )
109
+ echo " Unsupported flavor: ${FLAVOR} "
110
+ exit 1
111
+ ;;
112
+ esac
115
113
116
114
if ! gcloud compute instances describe devstack --zone " ${GCP_ZONE} " > /dev/null 2>&1 ;
117
115
then
0 commit comments