Skip to content

Commit e6cbcfb

Browse files
committed
[run-with-webhook] Handle operator deploy by Openstack initialization
1 parent 7cc05b8 commit e6cbcfb

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
@@ -289,6 +289,17 @@ if [ -n "${CSV_NAME}" ]; then
289289

290290
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 0}]"
291291
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/webhookdefinitions', 'value': []}]"
292+
else
293+
# Handle operator deployed by Openstack Initialization resource
294+
CSV_NAME="$(oc get csv -n openstack-operators -l operators.coreos.com/openstack-operator.openstack-operators -o name)"
295+
296+
printf \
297+
"\n\tNow patching openstack operator CSV to scale down deployment resource.
298+
To restore it, use:
299+
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p=\"[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 1}]\""
300+
301+
oc patch "${CSV_NAME}" -n openstack-operators --type=json -p="[{'op': 'replace', 'path': '/spec/install/spec/deployments/0/spec/replicas', 'value': 0}]"
302+
oc scale --replicas=0 -n openstack-operators deploy/telemetry-operator-controller-manager
292303
fi
293304

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

0 commit comments

Comments
 (0)