From 9c4cd42c60351231f7a46c636495ffe89cd7e996 Mon Sep 17 00:00:00 2001 From: w3aman Date: Thu, 2 Sep 2021 21:32:33 +0530 Subject: [PATCH] fix(e2e): Change hard-coded value of openebs namespace to env variable Signed-off-by: w3aman --- .../functional/backup_and_restore/backup.yml | 10 ++++++++++ ...mental_backup_vsl.yml => incremental_backup_vsl.j2} | 2 +- .../functional/backup_and_restore/run_e2e_test.yml | 3 +++ .../functional/backup_and_restore/test_vars.yml | 1 + ...apshot_location.yml => volume_snapshot_location.j2} | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) rename e2e-tests/experiments/functional/backup_and_restore/{incremental_backup_vsl.yml => incremental_backup_vsl.j2} (69%) rename e2e-tests/experiments/functional/backup_and_restore/{volume_snapshot_location.yml => volume_snapshot_location.j2} (65%) diff --git a/e2e-tests/experiments/functional/backup_and_restore/backup.yml b/e2e-tests/experiments/functional/backup_and_restore/backup.yml index 0e85a84..6825c09 100644 --- a/e2e-tests/experiments/functional/backup_and_restore/backup.yml +++ b/e2e-tests/experiments/functional/backup_and_restore/backup.yml @@ -1,6 +1,11 @@ --- - block: + - name: Update the volume snapshot location yaml with zfs-operator namespace + template: + src: volume_snapshot_location.j2 + dest: volume_snapshot_location.yml + - name: Create the volume snapshot location which has the information about where the snapshot should be stored shell: kubectl apply -f ./volume_snapshot_location.yml args: @@ -44,6 +49,11 @@ - block: + - name: Update the volume snapshot location yaml with zfs-operator namespace + template: + src: incremental_backup_vsl.j2 + dest: incremental_backup_vsl.yml + - name: Create the volume snapshot location which has the information about where the snapshot should be stored shell: kubectl apply -f ./incremental_backup_vsl.yml args: diff --git a/e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.yml b/e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.j2 similarity index 69% rename from e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.yml rename to e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.j2 index fdfea36..bd408fa 100644 --- a/e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.yml +++ b/e2e-tests/experiments/functional/backup_and_restore/incremental_backup_vsl.j2 @@ -9,7 +9,7 @@ spec: bucket: velero prefix: zfs incrBackupCount: "2" # number of incremental backup we want to have - namespace: openebs # this is namespace where ZFS-LocalPV creates all the CRs, passed as OPENEBS_NAMESPACE env in the ZFS-LocalPV deployment + namespace: "{{zfs_operator_ns}}" # this is namespace where ZFS-LocalPV creates all the CRs, passed as OPENEBS_NAMESPACE env in the ZFS-LocalPV deployment provider: aws region: minio s3ForcePathStyle: "true" diff --git a/e2e-tests/experiments/functional/backup_and_restore/run_e2e_test.yml b/e2e-tests/experiments/functional/backup_and_restore/run_e2e_test.yml index cee77c9..fe2b60a 100644 --- a/e2e-tests/experiments/functional/backup_and_restore/run_e2e_test.yml +++ b/e2e-tests/experiments/functional/backup_and_restore/run_e2e_test.yml @@ -42,6 +42,9 @@ spec: - name: APP_PVC ## PVC name for application value: '' + - name: ZFS_OPERATOR_NAMESPACE ## Namespace in which all the resources created by zfs driver will be present + value: '' ## for e.g. zfsvolume (zv) will be in this namespace + - name: ACTION ## On basis of the value of this env, this playbook will perform tasks. value: '' ## Supported values: (backup, restore, schedule_backup, incremental_backup, incremental_restore) diff --git a/e2e-tests/experiments/functional/backup_and_restore/test_vars.yml b/e2e-tests/experiments/functional/backup_and_restore/test_vars.yml index a88e0b5..d178fca 100644 --- a/e2e-tests/experiments/functional/backup_and_restore/test_vars.yml +++ b/e2e-tests/experiments/functional/backup_and_restore/test_vars.yml @@ -3,6 +3,7 @@ app_ns: "{{ lookup('env','APP_NAMESPACE') }}" app_ns_new: "{{ lookup('env','RESTORE_NAMESPACE') }}" app_label: "{{ lookup('env','APP_LABEL') }}" app_pvc: "{{ lookup('env','APP_PVC') }}" +zfs_operator_ns: "{{ lookup('env','ZFS_OPERATOR_NAMESPACE') }}" velero_backup_name: "{{ lookup('env','VELERO_BACKUP_NAME') }}" velero_plugin_name: "{{ lookup('env','VELERO_PLUGIN_NAME') }}" velero_version: "{{ lookup('env','VELERO_VERSION') }}" diff --git a/e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.yml b/e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.j2 similarity index 65% rename from e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.yml rename to e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.j2 index b67833c..bda207e 100644 --- a/e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.yml +++ b/e2e-tests/experiments/functional/backup_and_restore/volume_snapshot_location.j2 @@ -8,7 +8,7 @@ spec: config: bucket: velero prefix: zfs - namespace: openebs # this is namespace where ZFS-LocalPV creates all the CRs, passed as OPENEBS_NAMESPACE env in the ZFS-LocalPV deployment + namespace: "{{zfs_operator_ns}}" # this is namespace where ZFS-LocalPV creates all the CRs, passed as OPENEBS_NAMESPACE env in the ZFS-LocalPV deployment provider: aws region: minio s3ForcePathStyle: "true"