From 7159533385f6dcaf67f28e1b985e341ac71e5379 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Tue, 16 Apr 2024 23:26:55 +0100 Subject: [PATCH] Set default secret in libvirt service Depends-On: https://github.com/openstack-k8s-operators/install_yamls/pull/806 Related: OSPRH-6172 --- ...ane_v1beta1_openstackdataplaneservice_libvirt.yaml | 4 ++++ .../00-dataplane-create.yaml | 7 +++++++ .../01-assert.yaml | 11 +++++++++++ .../00-dataplane-create.yaml | 7 +++++++ .../dataplane-deploy-no-nodes-test/01-assert.yaml | 11 +++++++++++ 5 files changed, 40 insertions(+) diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml index fe568098b..82b70cc50 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml @@ -4,6 +4,10 @@ metadata: name: libvirt spec: playbook: osp.edpm.libvirt + secrets: + # NOTE: this Secret needs to be created before deploying the data plane. + # It should contain the libvirt sasl auth password using the key LibvirtPassword + - libvirt-secret tlsCert: contents: - dnsnames diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml index fbdbcb4d7..629ec70b1 100644 --- a/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml @@ -58,6 +58,13 @@ data: ssh-privatekey: ZmFrZQo= ssh-publickey: ZmFrZQo= --- +apiVersion: v1 +kind: Secret +metadata: + name: libvirt-secret +data: + LibvirtPassword: ZmFrZQo= +--- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml index 9731e63f9..e7757a2ce 100644 --- a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml @@ -883,6 +883,17 @@ spec: backoffLimit: 6 envConfigMapName: openstack-aee-default-env extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/libvirt/LibvirtPassword + name: libvirt-secret-0 + subPath: LibvirtPassword + volumes: + - name: libvirt-secret-0 + secret: + items: + - key: LibvirtPassword + path: LibvirtPassword + secretName: libvirt-secret - mounts: - mountPath: /runner/env/ssh_key name: ssh-key diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml index bb5af3ef6..23e5d5cf1 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml @@ -59,6 +59,13 @@ data: ssh-privatekey: ZmFrZQo= ssh-publickey: ZmFrZQo= --- +apiVersion: v1 +kind: Secret +metadata: + name: libvirt-secret +data: + LibvirtPassword: ZmFrZQo= +--- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml index 223b6df25..6e1e3f875 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml @@ -808,6 +808,17 @@ spec: backoffLimit: 6 envConfigMapName: openstack-aee-default-env extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/libvirt/LibvirtPassword + name: libvirt-secret-0 + subPath: LibvirtPassword + volumes: + - name: libvirt-secret-0 + secret: + items: + - key: LibvirtPassword + path: LibvirtPassword + secretName: libvirt-secret - mounts: - mountPath: /runner/env/ssh_key name: ssh-key