diff --git a/pkg/modules/application_mobility.go b/pkg/modules/application_mobility.go index d39705669..f3e89ba0c 100644 --- a/pkg/modules/application_mobility.go +++ b/pkg/modules/application_mobility.go @@ -92,10 +92,10 @@ const ( InitContainerImage = "" //AccessContents - contents of the object store secret AccessContents = "" - //AccessKeyID - contains the aws access key id - AccessKeyID = "" - //AccessKey - contains the aws access key - AccessKey = "" + //AKeyID - contains the aws access key id + AKeyID = "" + //AKey - contains the aws access key + AKey = "" // AppMobCtrlMgrComponent - component name in cr for app-mobility controller-manager AppMobCtrlMgrComponent = "application-mobility-controller-manager" @@ -142,11 +142,10 @@ func VeleroCrdDeploy(ctx context.Context, isDeleting bool, op utils.OperatorConf if err != nil { return err } - err = applyDeleteObjects(ctx, ctrlClient, yamlString, isDeleting) - if err != nil { - return err + er := applyDeleteObjects(ctx, ctrlClient, yamlString, isDeleting) + if er != nil { + return er } - return nil } @@ -437,8 +436,8 @@ func getCreateVeleroAccess(op utils.OperatorConfig, cr csmv1.ContainerStorageMod yamlString = strings.ReplaceAll(yamlString, VeleroNamespace, veleroNS) yamlString = strings.ReplaceAll(yamlString, VeleroAccess, credName) - yamlString = strings.ReplaceAll(yamlString, AccessKeyID, accessID) - yamlString = strings.ReplaceAll(yamlString, AccessKey, access) + yamlString = strings.ReplaceAll(yamlString, AKeyID, accessID) + yamlString = strings.ReplaceAll(yamlString, AKey, access) return yamlString, nil } @@ -746,19 +745,8 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string veleroNS := "" veleroImgPullPolicy := "" veleroImg := "" - credName := "" objectSecretName := "" - for _, component := range appMob.Components { - if component.Name == AppMobCtrlMgrComponent { - for _, env := range component.Envs { - if strings.Contains(AppMobObjStoreSecretName, env.Name) { - objectSecretName = env.Value - } - } - } - } - for _, component := range appMob.Components { if component.Name == AppMobVeleroComponent { if component.Image != "" { @@ -771,8 +759,8 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string if strings.Contains(VeleroNamespace, env.Name) { veleroNS = env.Value } - if strings.Contains(VeleroAccess, env.Name) { - credName = env.Value + if strings.Contains(AppMobObjStoreSecretName, env.Name) { + objectSecretName = env.Value } } @@ -788,9 +776,7 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string yamlString = strings.ReplaceAll(yamlString, VeleroImage, veleroImg) yamlString = strings.ReplaceAll(yamlString, VeleroNamespace, veleroNS) - yamlString = strings.ReplaceAll(yamlString, VeleroAccess, credName) yamlString = strings.ReplaceAll(yamlString, VeleroImagePullPolicy, veleroImgPullPolicy) - yamlString = strings.ReplaceAll(yamlString, AppMobObjStoreSecretName, objectSecretName) return yamlString, nil } diff --git a/tests/e2e/go.sum b/tests/e2e/go.sum index 324bcf553..1fb368299 100644 --- a/tests/e2e/go.sum +++ b/tests/e2e/go.sum @@ -252,8 +252,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= diff --git a/tests/e2e/steps/step_common.go b/tests/e2e/steps/step_common.go index 32d3d116d..f8f1ff24a 100644 --- a/tests/e2e/steps/step_common.go +++ b/tests/e2e/steps/step_common.go @@ -356,7 +356,7 @@ func checkApplicationMobilityPods(namespace string, k8sClient kubernetes.Interfa for _, pod := range allPods { podMsg, podRunning := arePodsRunning(pod) - if podRunning == false { + if podRunning == false && pod.Status.Phase != "Succeeded" { return fmt.Errorf("pod %s not running: %+v", pod.Name, podMsg) } } diff --git a/tests/e2e/steps/steps_def.go b/tests/e2e/steps/steps_def.go index 2cc1d92a0..e7e1c63b8 100644 --- a/tests/e2e/steps/steps_def.go +++ b/tests/e2e/steps/steps_def.go @@ -305,9 +305,6 @@ func (step *Step) validateModuleNotInstalled(res Resource, module string, crNumS case csmv1.Resiliency: return step.validateResiliencyNotInstalled(cr) - - //case csmv1.ApplicationMobility: - // return step.validateAppMobNotInstalled(cr) } } } @@ -863,7 +860,8 @@ func (step *Step) validateAuthorizationProxyServerNotInstalled(cr csmv1.Containe } func (step *Step) validateAppMobInstalled(cr csmv1.ContainerStorageModule) error { - time.Sleep(5 * time.Second) + //providing additional time to get appmob pods up to running + time.Sleep(10 * time.Second) instance := new(csmv1.ContainerStorageModule) if err := step.ctrlClient.Get(context.TODO(), client.ObjectKey{ Namespace: cr.Namespace, @@ -890,7 +888,7 @@ func (step *Step) validateAppMobInstalled(cr csmv1.ContainerStorageModule) error } // provide few seconds for cluster to settle down - time.Sleep(20 * time.Second) + time.Sleep(10 * time.Second) return nil } diff --git a/tests/e2e/testfiles/alt-velero-secret.yaml b/tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml similarity index 86% rename from tests/e2e/testfiles/alt-velero-secret.yaml rename to tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml index 71be23a65..5412b9f8d 100644 --- a/tests/e2e/testfiles/alt-velero-secret.yaml +++ b/tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml @@ -11,4 +11,4 @@ stringData: cloud: | [default] aws_access_key_id=access_key - aws_secret_access_key=secret_access_key + aws_secret_access_key=access_key123 diff --git a/tests/e2e/testfiles/velero-secret.yaml b/tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml similarity index 80% rename from tests/e2e/testfiles/velero-secret.yaml rename to tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml index 1def92e57..d6cda5483 100644 --- a/tests/e2e/testfiles/velero-secret.yaml +++ b/tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: cloud-creds + name: existing-cred namespace: application-mobility labels: app.kubernetes.io/name: application-mobility-velero @@ -11,4 +11,4 @@ stringData: cloud: | [default] aws_access_key_id=access_key - aws_secret_access_key=secret_access_key \ No newline at end of file + aws_secret_access_key=secret_access_key123 \ No newline at end of file diff --git a/tests/e2e/testfiles/appmob-values.yaml b/tests/e2e/testfiles/appmob-values.yaml index 8184ab952..f1b64f263 100644 --- a/tests/e2e/testfiles/appmob-values.yaml +++ b/tests/e2e/testfiles/appmob-values.yaml @@ -1,4 +1,4 @@ -- scenario: "Install App Mobility with Velero and Cert-Manager already installed" +- scenario: "Install App Mobility with all features enabled while Velero and Cert-Manager already installed" paths: - "testfiles/csm_application_mobility_vanilla.yaml" modules: @@ -20,19 +20,17 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility Controller with different env variables than default" +- scenario: "Install App Mobility Controller manager with different env variables along with velero" paths: - "testfiles/csm_application_mobility_controller_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" #- "Run custom test" # Last two steps perform Clean Up - - "Uninstall [velero]" - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" @@ -44,63 +42,29 @@ - scenario: "Install App Mobility Velero with different env variables than default" paths: + - "testfiles/application-mobility-templates/alt-velero-secret.yaml" - "testfiles/csm_application_mobility_velero_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" + - "Apply custom resource [2]" + - "Validate [application-mobility] module from CR [2] is installed" #- "Run custom test" # Last two steps perform Clean Up - "Uninstall [cert-manager]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager" - paths: - - "testfiles/csm_application_mobility_cert_manager.yaml" - modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - #- "Run custom test" - # Last two steps perform Clean Up - - "Uninstall [velero]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager and Velero" - paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - #- "Run custom test" - # Last two steps perform Clean Up - - "Enable forceRemoveModule on CR [1]" + - "Enable forceRemoveModule on CR [2]" - "Delete custom resource [1]" + - "Delete custom resource [2]" customTest: # name of custom test to run name: verify app-mobility run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with velero when cert-manager is already installed" +- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" paths: - "testfiles/csm_application_mobility_test_velero.yaml" modules: @@ -117,16 +81,13 @@ customTest: # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: # ./hello_world.sh run: - sh verify-app-mobility.sh - scenario: "Install App Mobility with powerflex driver" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" + - "testfiles/csm_application_mobility_vanilla.yaml" - "testfiles/storage_csm_powerflex.yaml" modules: steps: @@ -146,10 +107,6 @@ customTest: # name of the custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: # ./hello_world.sh run: - sh verify-app-mobility.sh - diff --git a/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml b/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml index ac660a181..1aef83a35 100644 --- a/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml @@ -27,12 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: velero-restic-credentials - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "velero-restic-credentials" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -41,49 +36,75 @@ spec: # Default value: false - name: cert-manager enabled: true - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: false + cleanUpCRDs: false + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: false + #Specify the name to be used for secret that will be created to hold object store credentials. + name: cloud-creds + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: #Provide the access key id here + aws_secret_access_key: #provide the access key here + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml b/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml index 6d6645b4b..5baf47ec9 100644 --- a/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml @@ -27,7 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "alt-license" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -36,49 +36,75 @@ spec: # Default value: false - name: cert-manager enabled: false - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: false + cleanUpCRDs: false + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: false + #Specify the name to be used for secret that will be created to hold object store credentials. + name: cloud-creds + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: #Provide the access key id here + aws_secret_access_key: #provide the access key here + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml b/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml index c3223606f..3714a88db 100644 --- a/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml @@ -35,15 +35,15 @@ spec: # false: disable deployment of cert-manager only if it's already deployed # Default value: false - name: cert-manager - enabled: true + enabled: false # enabled: Enable/Disable Velero - name: velero image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - useVolumeSnapshot: false - cleanUpCRDs: false - # enabled: Enable/Disable Velero and Restic Services + enabled: true + useVolumeSnapshot: true + cleanUpCRDs: true + # enabled: Enable/Disable Restic Services deployRestic: true envs: # Backup storage location name @@ -94,8 +94,8 @@ spec: name: cloud-creds #Specify the object store access credentials to be stored in a secret with key "cloud". secretContents: - aws_access_key_id: #Provide the access key id here - aws_secret_access_key: #provide the access key here + aws_access_key_id: keyid + aws_secret_access_key: key123 # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. @@ -108,5 +108,3 @@ spec: #initContainer image for the configuration-provider - aws - name: velero-plugin-for-aws image: velero/velero-plugin-for-aws:v1.5.0 - - diff --git a/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml b/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml index 2e3d6b956..ad4b763de 100644 --- a/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml @@ -27,12 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: velero-restic-credentials - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "velero-restic-credentials" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -40,51 +35,76 @@ spec: # false: disable deployment of cert-manager only if it's already deployed # Default value: false - name: cert-manager - enabled: false - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + enabled: true + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: true + cleanUpCRDs: true + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: true + #Specify the name to be used for secret that will be created to hold object store credentials. + name: velero-cred + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: keyid + aws_secret_access_key: key123 + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml b/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml index 777f3d55c..b819cb22f 100644 --- a/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml @@ -22,12 +22,12 @@ spec: # Allowed values: string # Default value: 1 - name: "APPLICATION_MOBILITY_REPLICA_COUNT" - value: "2" + value: "1" # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "alt-license" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -43,20 +43,20 @@ spec: enabled: true useVolumeSnapshot: false cleanUpCRDs: false - # enabled: Enable/Disable Velero and Restic Services + # enabled: Enable/Disable Restic Services deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" - value: "default" + value: "alt-backupname" # Velero bucket name # Allowed values: string # Default value: my-bucket - name: "BUCKET_NAME" - value: "my-bucket" + value: "my-alt-bucket" # Namespace for Velero installation # Default value: application-mobility @@ -66,30 +66,30 @@ spec: # Based on the objectstore being used, the velero plugin and its configuration may need to change! # default value: aws - name: "PROVIDER" - value: "aws" + value: "csi" # Name of the volume snapshot location where snapshots are being taken. Required. # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER # Default value : default - name: "VOL_SNAPSHOT_LOCATION_NAME" - value: "default" + value: "alt-vol-snapshot" # Name of the backup storage url # This field has to be changed to a functional backup storage url - # Default value: localhost:8000 + # Default value: existing-cred - name: "BACKUP_STORAGE_URL" - value: "localhost:8000" + value: "localhost:1000" # Name of the secret in velero namespace that has credentials to access object store # We can leave the field empty if there no existing secret in velero installed namespace # Default value: existing-cred - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "existing-cred" + value: "alt-cloud-cred" #If velero is not already present in cluster, set enabled to true to create a secret. #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. credentials: - - enabled: true + - enabled: false #Specify the name to be used for secret that will be created to hold object store credentials. name: cloud-creds #Specify the object store access credentials to be stored in a secret with key "cloud". @@ -108,5 +108,3 @@ spec: #initContainer image for the configuration-provider - aws - name: velero-plugin-for-aws image: velero/velero-plugin-for-aws:v1.5.0 - - diff --git a/tests/e2e/testfiles/values.yaml b/tests/e2e/testfiles/values.yaml index e26bbf3c9..d7bde84a5 100644 --- a/tests/e2e/testfiles/values.yaml +++ b/tests/e2e/testfiles/values.yaml @@ -1399,7 +1399,7 @@ run: - ./cert-csi test vio --sc unity --chainNumber 2 --chainLength 2 -- scenario: "Install App Mobility with Velero and Cert-Manager already installed" +- scenario: "Install App Mobility with all features enabled while Velero and Cert-Manager already installed" paths: - "testfiles/csm_application_mobility_vanilla.yaml" modules: @@ -1421,19 +1421,17 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility Controller with different env variables than default" +- scenario: "Install App Mobility Controller manager with different env variables along with velero" paths: - "testfiles/csm_application_mobility_controller_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" - "Run custom test" # Last two steps perform Clean Up - - "Uninstall [velero]" - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" @@ -1449,6 +1447,7 @@ modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" @@ -1467,26 +1466,6 @@ paths: - "testfiles/csm_application_mobility_cert_manager.yaml" modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - - "Run custom test" - # Last two steps perform Clean Up - - "Uninstall [velero]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager and Velero" - paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - "Apply custom resource [1]" @@ -1501,7 +1480,7 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" +- scenario: "Install App Mobility with velero when cert-manager is already installed" paths: - "testfiles/csm_application_mobility_test_velero.yaml" modules: @@ -1518,47 +1497,32 @@ customTest: # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with powerflex driver" +- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - - "testfiles/storage_csm_powerflex.yaml" + - "testfiles/csm_application_mobility_test_velero.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" - - "Create storageclass with name [op-e2e-vxflexos] and template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" - - "Set up secret with template [testfiles/powerflex-templates/powerflex-secret-template.yaml] name [test-vxflexos-config] in namespace [test-vxflexos] for [pflex]" - - "Apply custom resource [2]" - - "Validate custom resource [2]" - - "Validate [powerflex] driver from CR [2] is installed" - "Run custom test" # Last two steps perform Clean UP - - "Restore template [testfiles/powerflex-templates/powerflex-secret-template.yaml] for [pflex]" - - "Restore template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" + - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" - - "Delete custom resource [2]" customTest: - # name of the custom test to run + # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - sh verify-app-mobility.sh - scenario: "Install App Mobility with powerflex driver" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" + - "testfiles/csm_application_mobility_vanilla.yaml" - "testfiles/storage_csm_powerflex.yaml" modules: steps: @@ -1572,17 +1536,11 @@ - "Validate [powerflex] driver from CR [2] is installed" - "Run custom test" # Last two steps perform Clean UP - - "Restore template [testfiles/powerflex-templates/powerflex-secret-template.yaml] for [pflex]" - - "Restore template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" - "Delete custom resource [2]" customTest: # name of the custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - - sh verify-app-mobility.sh \ No newline at end of file + - sh verify-app-mobility.sh