Skip to content

Commit 8f41d4e

Browse files
committed
Add openstack_crds_cleanup and openstack_patch_version target
* The openstack_crds_cleanup target allows to remove all openstack related CRDs from an environment. All deployments need to be deleted before. * The openstack_patch_version target patches the OpenstackVersion target version to be the avaliable version to trigger an update. With this an operator update (reinstall) and a deployment update can be tested using this procedure: ~~~ make openstack_crds_cleanup OPENSTACK_IMG=quay.io/openstack-k8s-operators/openstack-operator-index:123 make openstack_wait TIMEOUT=600s make openstack_wait_deploy make openstack_cleanup make openstack_wait make openstack_patch_version ~~~ TODO: add targets to perform edpm deploy/update (ovn controller update and final service update) Depends-On: openstack-k8s-operators/openstack-operator#1217 Signed-off-by: Martin Schuppert <[email protected]>
1 parent e9ff886 commit 8f41d4e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,12 @@ openstack_update_run:
798798
$(eval $(call vars,$@,openstack))
799799
bash scripts/openstack-update.sh
800800

801+
OV := $(shell oc get openstackversion -n $(NAMESPACE) -o name)
802+
.PHONY: openstack_patch_version
803+
openstack_patch_version: ## patches the openstackversion target version to the available version, if there is an update available
804+
$(eval $(call vars,$@,openstack))
805+
oc wait -n ${NAMESPACE} ${OV} --for=condition=MinorUpdateAvailable --timeout=${TIMEOUT} && \
806+
oc patch -n ${NAMESPACE} ${OV} --type merge --patch '{"spec": {"targetVersion": "$(shell oc get -n $(NAMESPACE) ${OV} -o yaml | yq .status.availableVersion)"}}'
801807

802808
.PHONY: edpm_deploy_generate_keys
803809
edpm_deploy_generate_keys:
@@ -937,6 +943,10 @@ edpm_nova_discover_hosts: ## trigger manual compute host discovery in nova
937943
openstack_crds: namespace openstack_deploy_prep ## installs all openstack CRDs. Useful for infrastructure dev
938944
OPENSTACK_BUNDLE_IMG=${OPENSTACK_BUNDLE_IMG} OUT=${OUT} OPENSTACK_CRDS_DIR=${OPENSTACK_CRDS_DIR} OPERATOR_BASE_DIR=${OPERATOR_BASE_DIR} bash scripts/openstack-crds.sh
939945

946+
.PHONY: openstack_crds_cleanup
947+
openstack_crds_cleanup: ## deletes all openstack CRDs. Useful for installing a ga version. expects that all deployments are gone before
948+
oc delete $$(oc get crd -o name |grep 'openstack\.org')
949+
940950
.PHONY: edpm_deploy_networker_prep
941951
edpm_deploy_networker_prep: export KIND=OpenStackDataPlaneNodeSet
942952
edpm_deploy_networker_prep: export EDPM_ANSIBLE_SECRET=${DATAPLANE_ANSIBLE_SECRET}

0 commit comments

Comments
 (0)