From 3cfcb5999afb9103150bbbdc479a159b2c3228cf Mon Sep 17 00:00:00 2001 From: Ryotaro Banno Date: Wed, 13 Nov 2024 08:17:45 +0000 Subject: [PATCH] test/e2e: use RGW for e2e testing Signed-off-by: Ryotaro Banno --- .gitignore | 1 + charts/mantle/templates/deployment.yaml | 14 +++++++++++++- test/e2e/Makefile | 7 +++++++ .../testdata/values-mantle-primary-template.yaml | 6 ++++-- ....yaml => values-mantle-secondary-template.yaml} | 5 +++-- 5 files changed, 28 insertions(+), 5 deletions(-) rename test/e2e/testdata/{values-mantle-secondary.yaml => values-mantle-secondary-template.yaml} (56%) diff --git a/.gitignore b/.gitignore index 4d42b5f3..ef326d76 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ Dockerfile.cross test/e2e/testdata/persistentvolumes.yaml test/e2e/testdata/values-mantle-primary.yaml +test/e2e/testdata/values-mantle-secondary.yaml include/ diff --git a/charts/mantle/templates/deployment.yaml b/charts/mantle/templates/deployment.yaml index a9b7664d..812a1c3d 100644 --- a/charts/mantle/templates/deployment.yaml +++ b/charts/mantle/templates/deployment.yaml @@ -70,9 +70,21 @@ spec: {{- with .Values.controller.objectStorageBucketName }} - --object-storage-bucket-name={{ . }} {{- end }} - {{- with .Values.controller.objectStorageEndpoint}} + {{- with .Values.controller.objectStorageEndpoint }} - --object-storage-endpoint={{ . }} {{- end }} + {{- with .Values.controller.envSecret }} + - --env-secret={{ . }} + {{- end }} + {{- with .Values.controller.caCertConfigMap }} + - --ca-cert-configmap={{ . }} + {{- end }} + {{- with .Values.controller.caCertKey }} + - --ca-cert-key={{ . }} + {{- end }} + {{- with .Values.controller.exportDataStorageClass }} + - --export-data-storage-class={{ . }} + {{- end }} env: - name: POD_NAME valueFrom: diff --git a/test/e2e/Makefile b/test/e2e/Makefile index 4d99e907..1b45ef7d 100644 --- a/test/e2e/Makefile +++ b/test/e2e/Makefile @@ -61,6 +61,11 @@ test-multiple-k8s-clusters: $(MAKE) install-rook-ceph-cluster1 $(MAKE) install-ceph-object-store $(MAKE) install-mantle-cluster-wide + sed \ + -e "s%{OBJECT_STORAGE_BUCKET_NAME}%$$(cat $(TMPDIR)/cm-export-data.json | jq -r .data.BUCKET_NAME)%" \ + -e "s%{OBJECT_STORAGE_ENDPOINT}%http://$$(cat $(TMPDIR)/cm-export-data.json | jq -r .data.BUCKET_HOST)%" \ + testdata/values-mantle-secondary-template.yaml \ + > testdata/values-mantle-secondary.yaml $(MAKE) install-mantle \ NAMESPACE=$(CEPH_CLUSTER1_NAMESPACE) \ HELM_RELEASE=mantle \ @@ -73,6 +78,8 @@ test-multiple-k8s-clusters: $(MAKE) install-mantle-cluster-wide sed \ -e "s%{ENDPOINT}%$$($(MINIKUBE) service list -p $(MINIKUBE_PROFILE_SECONDARY) -o json | jq -r '.[] | select(.Name == "mantle" and .Namespace == "rook-ceph") | .URLs | select(. | length > 0)[]' | head -1 | sed -r 's/^http:\/\///')%" \ + -e "s%{OBJECT_STORAGE_BUCKET_NAME}%$$(cat $(TMPDIR)/cm-export-data.json | jq -r .data.BUCKET_NAME)%" \ + -e "s%{OBJECT_STORAGE_ENDPOINT}%$$($(MINIKUBE) service list -p $(MINIKUBE_PROFILE_SECONDARY) -o json | jq -r '.[] | select(.Name == "rook-ceph-rgw-ceph-object-store-node-port" and .Namespace == "rook-ceph") | .URLs | select(. | length > 0)[]' | head -1)%" \ testdata/values-mantle-primary-template.yaml \ > testdata/values-mantle-primary.yaml $(MAKE) install-mantle \ diff --git a/test/e2e/testdata/values-mantle-primary-template.yaml b/test/e2e/testdata/values-mantle-primary-template.yaml index 544397ff..838aa7b5 100644 --- a/test/e2e/testdata/values-mantle-primary-template.yaml +++ b/test/e2e/testdata/values-mantle-primary-template.yaml @@ -1,5 +1,7 @@ controller: role: primary mantleServiceEndpoint: {ENDPOINT} - objectStorageBucketName: dummy - objectStorageEndpoint: dummy + objectStorageBucketName: {OBJECT_STORAGE_BUCKET_NAME} + objectStorageEndpoint: {OBJECT_STORAGE_ENDPOINT} + envSecret: export-data + exportDataStorageClass: rook-ceph-block diff --git a/test/e2e/testdata/values-mantle-secondary.yaml b/test/e2e/testdata/values-mantle-secondary-template.yaml similarity index 56% rename from test/e2e/testdata/values-mantle-secondary.yaml rename to test/e2e/testdata/values-mantle-secondary-template.yaml index 53ea00ed..560d8a6c 100644 --- a/test/e2e/testdata/values-mantle-secondary.yaml +++ b/test/e2e/testdata/values-mantle-secondary-template.yaml @@ -3,8 +3,9 @@ controller: mantleServiceEndpoint: ":58080" ports: - containerPort: 58080 - objectStorageBucketName: dummy - objectStorageEndpoint: dummy + objectStorageBucketName: {OBJECT_STORAGE_BUCKET_NAME} + objectStorageEndpoint: {OBJECT_STORAGE_ENDPOINT} + envSecret: export-data secondaryService: type: NodePort