File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 15
15
CLUSTER=$1
16
16
VERSION=$2
17
17
NAMESPACE=$3
18
- VCLUSTER_MODE=${4:- }
18
+
19
+ # Treat the optional fourth argument "--vcluster" as a boolean flag
20
+ IS_VCLUSTER=false
21
+ if [[ " ${4:- } " == " --vcluster" ]]; then
22
+ IS_VCLUSTER=true
23
+ fi
19
24
20
25
# Choose kubectl and helm commands depending if we run on vCluster
21
- if [[ " $VCLUSTER_MODE " == " --vcluster " ]] ; then
26
+ if $IS_VCLUSTER ; then
22
27
KUBECTL=" vcluster connect ${CLUSTER} -n ${NAMESPACE} -- kubectl"
23
28
HELM=" vcluster connect ${CLUSTER} -n ${NAMESPACE} -- helm"
24
29
else
80
85
exit 1
81
86
fi
82
87
83
- if [[ " $VCLUSTER_MODE " == " --vcluster " ]] ; then
88
+ if $IS_VCLUSTER ; then
84
89
echo " [Running in vCluster mode] skipping docker pull and kind load for remote images."
85
90
sleep 15
86
91
else
@@ -97,7 +102,7 @@ docker build -t netbox-load-local-data:1.0 --load --no-cache --progress=plain -f
97
102
cd -
98
103
99
104
# Load local images into Kind only if not vCluster
100
- if [[ " $VCLUSTER_MODE " != " --vcluster " ]] ; then
105
+ if ! $IS_VCLUSTER ; then
101
106
echo " Loading local images into kind cluster..."
102
107
declare -a Local_Images=( \
103
108
" netbox-load-local-data:1.0" \
@@ -121,9 +126,10 @@ ${HELM} upgrade --install postgres-operator \
121
126
# Deploy the database
122
127
${KUBECTL} apply --namespace=" ${NAMESPACE} " -f " $( dirname " $0 " ) /netbox-db.yaml"
123
128
${KUBECTL} wait --namespace=" ${NAMESPACE} " --timeout=600s --for=jsonpath=' {.status.PostgresClusterStatus}' =Running postgresql/netbox-db
129
+
124
130
echo " loading demo-data into NetBox…"
125
131
126
- if [[ " $VCLUSTER_MODE " == " --vcluster " ]] ; then
132
+ if $IS_VCLUSTER ; then
127
133
# — vCluster —
128
134
echo " → inside the vcluster"
129
135
kubectl create configmap netbox-demo-data-load-job-scripts \
You can’t perform that action at this time.
0 commit comments