Skip to content

Commit 8a13398

Browse files
Merge pull request #964 from stuggi/patch_openstackversion
Add openstack_crds_cleanup and openstack_patch_version target
2 parents 5a4d9bc + 8f41d4e commit 8a13398

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
@@ -802,6 +802,12 @@ openstack_update_run:
802802
$(eval $(call vars,$@,openstack))
803803
bash scripts/openstack-update.sh
804804

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

806812
.PHONY: edpm_deploy_generate_keys
807813
edpm_deploy_generate_keys:
@@ -941,6 +947,10 @@ edpm_nova_discover_hosts: ## trigger manual compute host discovery in nova
941947
openstack_crds: namespace openstack_deploy_prep ## installs all openstack CRDs. Useful for infrastructure dev
942948
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
943949

950+
.PHONY: openstack_crds_cleanup
951+
openstack_crds_cleanup: ## deletes all openstack CRDs. Useful for installing a ga version. expects that all deployments are gone before
952+
oc delete $$(oc get crd -o name |grep 'openstack\.org')
953+
944954
.PHONY: edpm_deploy_networker_prep
945955
edpm_deploy_networker_prep: export KIND=OpenStackDataPlaneNodeSet
946956
edpm_deploy_networker_prep: export EDPM_ANSIBLE_SECRET=${DATAPLANE_ANSIBLE_SECRET}

0 commit comments

Comments
 (0)