Uploaded image for project: 'OpenShift API for Data Protection'
  1. OpenShift API for Data Protection
  2. OADP-3053

Multiple BackupStorageLocations can be set as default

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • oadp-operator-bundle-container-1.3.0-152
    • ToDo
    • 0
    • 0
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown
    • No

      Description of problem:

      We can create multiple BSL CR with default flag set to true. From the behaviour it seems backup_storage_location_controller is consider the last backup location it founds during the for loop as default.  Velero should allows to only set one default BSL at a time. 

      https://github.com/vmware-tanzu/velero/blob/main/pkg/controller/backup_storage_location_controller.go#L96

       

       

      Version-Release number of selected component (if applicable):
      OADP 1.3.0-147

       

      How reproducible:
      Always

       

      Steps to Reproduce:
      1.  Create a DPA with multiple BSL location set as default.

      $ oc get dpa ts-dpa -o yaml
      apiVersion: oadp.openshift.io/v1alpha1
      kind: DataProtectionApplication
      metadata:
        creationTimestamp: "2023-11-07T06:52:46Z"
        generation: 6
        name: ts-dpa
        namespace: openshift-adp
        resourceVersion: "115621"
        uid: de65e475-24da-4152-819e-367099494ea6
      spec:
        backupLocations:
        - velero:
            config:
              insecureSkipTLSVerify: "true"
              profile: noobaa
              region: noobaa
              s3ForcePathStyle: "true"
              s3Url: http://s3-openshift-storage.apps.oadp-61240.qe.devcluster.openshift.com
            credential:
              key: cloud
              name: cloud-credentials
            default: true
            objectStorage:
              bucket: oadpbucket245076
              prefix: velero
            provider: aws
        - velero:
            config:
              insecureSkipTLSVerify: "true"
              profile: noobaa
              region: noobaa
              s3ForcePathStyle: "true"
              s3Url: http://s3-openshift-storage.apps.oadp-61240.qe.devcluster.openshift.com
            credential:
              key: cloud
              name: cloud-credentials
            default: true
            objectStorage:
              bucket: oadpbucket245076
              prefix: velero
            provider: aws
        configuration:
          nodeAgent:
            enable: true
            podConfig:
              resourceAllocations:
                limits:
                  cpu: 100m
                  memory: 50Mi
                requests:
                  cpu: 50m
                  memory: 10Mi
            uploaderType: kopia
          velero:
            defaultPlugins:
            - openshift
            - aws
            - csi

      Actual results:

      Mutiple backup locations can have default value set as true. 

      $ oc get bsl 
      NAME       PHASE       LAST VALIDATED   AGE     DEFAULT
      ts-dpa-1   Available   51s              3h23m   true
      ts-dpa-2   Available   21s              113m    true

      Expected results:

      BSL should have an error if multiple CR has default value set as true. 

      Additional info:

          There are no Sub-Tasks for this issue.

              sseago Scott Seago
              rhn-support-prajoshi Prasad Joshi
              Prasad Joshi Prasad Joshi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: