Skip to content

Commit

Permalink
automate removal of nova from csv and webhook setup
Browse files Browse the repository at this point in the history
This change updates run-with-webhooks to clean the local
webhooks before settign them up again. it also add a new
remove-nova-from-csv target to automate the removal of the
nova operator from the meta operator csv.
  • Loading branch information
SeanMooney authored and openshift-merge-robot committed Jun 2, 2023
1 parent ebaeca6 commit b1987e7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ gowork: ## Generate go.work file
go work use ./api
go work sync

remove-nova-from-csv:
@echo "Removing nova-controller-manager from CSV"
$(eval OPERATOR_NAME="nova-operator")
@echo "OPERATOR_NAME: $(OPERATOR_NAME)"
$(eval OPERATOR_INDEX=$(shell oc get csv openstack-operator.v0.0.1 -o json | jq -r '.spec.install.spec.deployments | map(.name == $(OPERATOR_NAME) + "-controller-manager") | index(true)'))
@echo "OPERATOR_INDEX: '$(OPERATOR_INDEX)'"
if [ "$(OPERATOR_INDEX)" != "null" ]; then \
oc patch csv openstack-operator.v0.0.1 --type json -p='[{"op": "remove", "path": "/spec/install/spec/deployments/${OPERATOR_INDEX}"}]'; \
fi

# Used for webhook testing
# Please ensure the nova-controller-manager deployment and
# webhook definitions are removed from the csv before running
Expand All @@ -359,6 +369,7 @@ gowork: ## Generate go.work file
# $oc delete -n openstack mutatingwebhookconfiguration/mnovascheduler.kb.io
SKIP_CERT ?=false
.PHONY: run-with-webhook
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
run-with-webhook: manifests generate fmt vet## Run a controller from your host.
/bin/bash hack/clean_local_webhook.sh
/bin/bash hack/configure_local_webhook.sh
go run ./main.go

0 comments on commit b1987e7

Please sign in to comment.