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

Secret name from config["credentialsFile"] should be configurable for registry

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • OADP 1.0.3
    • None
    • OADP
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Required
    • 0
    • 0
    • 0
    • None

      Value from bsl.config["credentialsFile"] are not picked up at all. Rather, it's using hard coded value from our pluginspecificfields.

      CI currently hardcodes credentialsFile making it inconfigurable for registry secret tests. It also mean the registry may not necessarily be using the same secret that Velero would be using during backup.
      Example, setting in dpa config["credentialsFile"]="something-else/key" didnt't result in that secret which has specific changes I was testing to be used for registry pod.

      This change is driven by the need to test https://issues.redhat.com//browse/OADP-463

      I would also think a customer may want to similarly specify this value like how we are doing it now in a format similar to our current CI.
      credentialsFile is a valid option to configure BackupStorageLocation
      code

      	if _, ok := bslSpec.Config["credentialsFile"]; ok { // <--Notice it ignored (_) value set here
      		secretName = credentials.PluginSpecificFields[plugin].BslSecretName
      		secretKey = credentials.PluginSpecificFields[plugin].PluginSecretKey
      	}
      

      Verification Steps:
      specify secret name and key in DPA like this
      DPA.backupLocations[].velero.config["credentialsFile"]: "<secretName>/<secretKey>"

      Example spec:

      spec: 
        backupLocations: 
          - velero: 
              config: 
                credentialsFile: bsl-cloud-credentials-aws-with-carriage-return/cloud
                profile: default
                region: us-east-1
              default: true
              objectStorage: 
                bucket: bucketName
                prefix: prefixName
              provider: aws
        configuration: 
          restic: 
            enable: true
            podConfig: 
              resourceAllocations: {}
          velero: 
            defaultPlugins: 
              - openshift
              - aws
              - kubevirt
            podConfig: 
              resourceAllocations: {}
        podDnsConfig: {}
      

      OADP operator log should contain specified bucket name. For the example above, operator log should contain "got provider secret name: bsl-cloud-credentials-aws-with-carriage-return" using above spec.

              tkaovila@redhat.com Tiger Kaovilai
              tkaovila@redhat.com Tiger Kaovilai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: