Skip to content

Commit 0b2c3aa

Browse files
Merge pull request #309 from karelyatin/openstack_init_resource
[run-with-webhook] Handle operator deploy by Openstack initialization
2 parents 41a7ff7 + ee5d0bb commit 0b2c3aa

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

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

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

0 commit comments

Comments
 (0)