Skip to content

Commit 930ce8c

Browse files
author
Mauricio Harley
committed
Add Barbican HSM custom image support
- Add new Makefile variables for HSM-enabled Barbican deployments: BARBICAN_API_IMAGE, BARBICAN_WORKER_IMAGE, BARBICAN_HSM_ENABLED - Add conditional logic to use custom images when HSM is enabled - Update barbican_deploy_prep target to handle custom image deployment - Add HSM backend selection in standalone openstack.sh script - Support PKCS#11 backend when BARBICAN_HSM_ENABLED=true Signed-off-by: Mauricio Harley <[email protected]>
1 parent dab263b commit 930ce8c

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ BARBICAN_DEPL_IMG ?= unused
174174
BARBICAN_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/barbican-operator/kuttl-test.yaml
175175
BARBICAN_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/barbican-operator/tests/kuttl/tests
176176
BARBICAN_KUTTL_NAMESPACE ?= barbican-kuttl-tests
177+
# HSM-enabled Barbican image overrides
178+
BARBICAN_API_IMAGE ?=
179+
BARBICAN_WORKER_IMAGE ?=
180+
BARBICAN_HSM_ENABLED ?= false
177181

178182
# Mariadb
179183
MARIADB_IMG ?= quay.io/openstack-k8s-operators/mariadb-operator-index:${OPENSTACK_K8S_TAG}
@@ -583,6 +587,15 @@ ${1}: export OPERATOR_SOURCE=$(OPERATOR_SOURCE)
583587
${1}: export OPERATOR_SOURCE_NAMESPACE=$(OPERATOR_SOURCE_NAMESPACE)
584588
endef
585589

590+
ifeq ($(BARBICAN_HSM_ENABLED),true)
591+
ifneq ($(BARBICAN_API_IMAGE),)
592+
BARBICAN_API_IMG := $(BARBICAN_API_IMAGE)
593+
endif
594+
ifneq ($(BARBICAN_WORKER_IMAGE),)
595+
BARBICAN_WORKER_IMG := $(BARBICAN_WORKER_IMAGE)
596+
endif
597+
endif
598+
586599
.PHONY: all
587600
all: operator_namespace keystone mariadb placement neutron
588601

@@ -771,6 +784,9 @@ openstack_wait: ## waits openstack CSV to succeed.
771784

772785
# creates the new initialization resource for our operators
773786
.PHONY: openstack_init
787+
openstack_init: export BARBICAN_API_IMAGE:=$(BARBICAN_API_IMAGE)
788+
openstack_init: export BARBICAN_WORKER_IMAGE:=$(BARBICAN_WORKER_IMAGE)
789+
openstack_init: export BARBICAN_HSM_ENABLED:=$(BARBICAN_HSM_ENABLED)
774790
openstack_init: openstack_wait
775791
bash -c 'test -f ${OPERATOR_BASE_DIR}/openstack-operator/config/samples/operator_v1beta1_openstack.yaml || make openstack_repo'
776792
oc apply -f ${OPERATOR_BASE_DIR}/openstack-operator/config/samples/operator_v1beta1_openstack.yaml
@@ -1250,6 +1266,8 @@ barbican_cleanup: ## deletes the operator, but does not cleanup the service reso
12501266

12511267
.PHONY: barbican_deploy_prep
12521268
barbican_deploy_prep: export KIND=Barbican
1269+
barbican_deploy_prep: export IMAGE=${BARBICAN_API_IMG:-unused},${BARBICAN_WORKER_IMG:-unused}
1270+
barbican_deploy_prep: export IMAGE_PATH=barbicanAPI/containerImage,barbicanWorker/containerImage
12531271
barbican_deploy_prep: export REPO=${BARBICAN_REPO}
12541272
barbican_deploy_prep: export BRANCH=${BARBICAN_BRANCH}
12551273
barbican_deploy_prep: export HASH=${BARBICAN_COMMIT_HASH}

devsetup/standalone/openstack.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ EOF
118118
fi
119119
if [ "$BARBICAN_ENABLED" = "true" ]; then
120120
ENV_ARGS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/services/barbican.yaml"
121-
ENV_ARGS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/barbican-backend-simple-crypto.yaml"
121+
if [ "$BARBICAN_HSM_ENABLED" = "true" ]; then
122+
ENV_ARGS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/barbican-backend-pkcs11.yaml"
123+
else
124+
ENV_ARGS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/barbican-backend-simple-crypto.yaml"
125+
fi
122126
fi
123127
if [ "$MANILA_ENABLED" = "true" ]; then
124128
ENV_ARGS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsnative-config.yaml"

0 commit comments

Comments
 (0)