Skip to content

Commit 2fbbe5f

Browse files
committed
[run-with-webhook] Handle operator deploy by Openstack initialization
1 parent dbb5120 commit 2fbbe5f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

hack/run_with_local_webhook.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ if [ -n "${CSV_NAME}" ]; then
119119

120120
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 0}]"
121121
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/webhookdefinitions', 'value': []}]"
122+
else
123+
# Handle operator deployed by Openstack Initialization resource
124+
CSV_NAME="$(oc get csv -n openstack-operators -l operators.coreos.com/openstack-operator.openstack-operators -o name)"
125+
126+
printf \
127+
"\n\tNow patching openstack operator CSV to scale down deployment resource.
128+
To restore it, use:
129+
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p=\"[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 1}]\""
130+
131+
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 0}]"
132+
oc scale --replicas=0 -n openstack-operators deploy/keystone-operator-controller-manager
122133
fi
123134

124135
go run ./main.go -metrics-bind-address ":${METRICS_PORT}" -health-probe-bind-address ":${HEALTH_PORT}"

0 commit comments

Comments
 (0)