Skip to content

Commit

Permalink
Add _deploy_validate mariadb_kuttl targets
Browse files Browse the repository at this point in the history
In order to make reusing simple, this change adds
a keystone_deploy_validate and mariadb_deploy_validate to quickly
validate those operators deployments. Addtionally, it also adds a new
target to run mariadb kuttl tests.
  • Loading branch information
cescgina committed Jan 10, 2023
1 parent 84bed0a commit 32b5531
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
out
pull-secret.txt
kuttl-test.json
kuttl-test-*.json
kubeconfig
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ MARIADB_BRANCH ?= master
MARIADB ?= config/samples/mariadb_v1beta1_mariadb.yaml
MARIADB_CR ?= ${OPERATOR_BASE_DIR}/mariadb-operator/${MARIADB}
MARIADB_DEPL_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-mariadb:current-tripleo
MARIADB_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/mariadb-operator/kuttl-test.yaml
MARIADB_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/mariadb-operator/tests/kuttl/tests

# Placement
PLACEMENT_IMG ?= quay.io/openstack-k8s-operators/placement-operator-index:latest
Expand Down Expand Up @@ -270,6 +272,10 @@ keystone_deploy: input keystone_deploy_prep ## installs the service instance usi
$(eval $(call vars,$@,keystone))
oc kustomize ${DEPLOY_DIR} | oc apply -f -

.PHONY: keystone_deploy_validate ## checks that keystone was properly deployed. Set KEYSTONE_KUTTL_DIR to use assert file from custom repo.
keystone_deploy_validate: input namespace
kubectl-kuttl assert -n ${NAMESPACE} ${KEYSTONE_KUTTL_DIR}/../common/assert_keystone_deployment.yaml --timeout 180

.PHONY: keystone_deploy_cleanup
keystone_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,keystone))
Expand All @@ -288,6 +294,10 @@ mariadb: namespace mariadb_prep ## installs the operator, also runs the prep ste
$(eval $(call vars,$@,mariadb))
oc apply -f ${OPERATOR_DIR}

.PHONY: mariadb_deploy_validate ## checks that mariadb was properly deployed. Set KEYSTONE_KUTTL_DIR to use assert file from custom repo.
mariadb_deploy_validate: input namespace
kubectl-kuttl assert -n ${NAMESPACE} ${MARIADB_KUTTL_DIR}/mariadb_deploy/01-assert.yaml --timeout 180

.PHONY: mariadb_cleanup
mariadb_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,mariadb))
Expand Down Expand Up @@ -679,6 +689,10 @@ nova_deploy_cleanup: ## cleans up the service instance, Does not affect the oper

##@ KUTTL tests

.PHONY: mariadb_kuttl
mariadb_kuttl: namespace input openstack_crds deploy_cleanup mariadb_deploy_prep mariadb ## runs kuttl tests for the mariadb operator. Installs openstack crds and keystone operators and cleans up previous deployments before running the tests.
INSTALL_YAMLS=${INSTALL_YAMLS} kubectl-kuttl test --config ${MARIADB_KUTTL_CONF} ${MARIADB_KUTTL_DIR}

.PHONY: keystone_kuttl
keystone_kuttl: namespace input openstack_crds deploy_cleanup keystone_deploy_prep mariadb keystone ## runs kuttl tests for the keystone operator. Installs openstack crds and keystone operators and cleans up previous deployments before running the tests.
keystone_kuttl: namespace input openstack_crds deploy_cleanup mariadb mariadb_deploy mariadb_deploy_validate keystone_deploy_prep keystone ## runs kuttl tests for the keystone operator. Installs openstack crds and keystone operators and cleans up previous deployments before running the tests.
INSTALL_YAMLS=${INSTALL_YAMLS} kubectl-kuttl test --config ${KEYSTONE_KUTTL_CONF} ${KEYSTONE_KUTTL_DIR}

0 comments on commit 32b5531

Please sign in to comment.