• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • 4
    • False
    • Hide

      None

      Show
      None
    • False
    • ToDo
    • 0
    • 0.000
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown

      Description of problem:

      In this case: TimeZone

      https://github.com/vmware-tanzu/velero/pull/2944

       

      We could ensure the oadp-controller also has the TZ config or we could better handle any env config available to velero container running in docker.

       

      Notes from Emily:
      Emily  12:34 PM

      I wonder if we could append it to the velero container here: https://github.com/openshift/oadp-operator/blob/master/controllers/velero.go#L486 (edited) 
       

      maybe could do something like add the value to the OADP api in the velero config (what Dylan pointed out). Write a func to check whether or not that value is set. If so, append that env var with the value in DPA to the velero container
       
      Notes from Dylan:
      https://github.com/openshift/oadp-operator/blob/master/api/v1alpha1/oadp_types.go#L66
       
       
      basically just add it here
       

      Which version we'll fix this in is TBD.

            [OADP-1249] [IBM QE-P] Verify Bug OADP-1150 - Handle docker env config changes in the oadp-operator

            Verified on OADP-1.1.2-16 -

             

            Test env variable in velero pod

             

            apiVersion: oadp.openshift.io/v1alpha1
            kind: DataProtectionApplication
            metadata:
              namespace: openshift-adp
              name: sqlcheck
            spec:
              backupLocations:
              - velero:
                  provider: aws
                  default: true
                  objectStorage:
                    bucket: ocp-aws-bucket
                    prefix: 'velero'
                  config:
                    profile: 'default'
                    region: us-east-1
                  credential:
                    name: cloud-credentials
                    key: cloud
              configuration:
                restic:
                  enable: true
                velero:
                  podConfig:
                    env:
                      - name: dpa
                        value: veleropod
                  defaultPlugins:
                    - openshift
                    - aws  

             

             

             

            # oc get po velero-54cf6b666f-2fvht -n openshift-adp -o jsonpath='{.spec.containers[*].env}' | jq
            [
              {
                "name": "VELERO_SCRATCH_DIR",
                "value": "/scratch"
              },
              {
                "name": "VELERO_NAMESPACE",
                "valueFrom": {
                  "fieldRef": {
                    "apiVersion": "v1",
                    "fieldPath": "metadata.namespace"
                  }
                }
              },
              {
                "name": "LD_LIBRARY_PATH",
                "value": "/plugins"
              },
              {
                "name": "dpa",
                "value": "veleropod"
              },
              {
                "name": "OPENSHIFT_IMAGESTREAM_BACKUP",
                "value": "true"
              }
            ]
             

             

             

            Test env variable in restic pod -

             

             

            kind: DataProtectionApplication
            metadata:
              namespace: openshift-adp
              name: sqlcheck
            spec:
              backupLocations:
              - velero:
                  provider: aws
                  default: true
                  objectStorage:
                    bucket: ocp-aws-bucket
                    prefix: 'velero'
                  config:
                    profile: 'default'
                    region: us-east-1
                  credential:
                    name: cloud-credentials
                    key: cloud
              configuration:
                restic:
                  podConfig:
                    env:
                      - name: dpa
                        value: Resticpod
                  enable: true
                velero:
                  defaultPlugins:
                    - openshift
                    - aws 

             

             

             

            # oc get po restic-mj8s6 -n openshift-adp -o jsonpath='{.spec.containers[*].env}' | jq
            [
              {
                "name": "NODE_NAME",
                "valueFrom": {
                  "fieldRef": {
                    "apiVersion": "v1",
                    "fieldPath": "spec.nodeName"
                  }
                }
              },
              {
                "name": "VELERO_NAMESPACE",
                "valueFrom": {
                  "fieldRef": {
                    "apiVersion": "v1",
                    "fieldPath": "metadata.namespace"
                  }
                }
              },
              {
                "name": "VELERO_SCRATCH_DIR",
                "value": "/scratch"
              },
              {
                "name": "dpa",
                "value": "Resticpod"
              }
            ] 

             

            Marking as verified.

             

             

            Sonia Garudi added a comment - Verified on OADP-1 .1.2-16 -   Test env variable in velero pod   apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata:   namespace: openshift-adp   name: sqlcheck spec:   backupLocations:   - velero:       provider: aws       default : true       objectStorage:         bucket: ocp-aws-bucket        prefix: 'velero'       config:         profile: ' default '         region: us-east-1       credential:         name: cloud-credentials         key: cloud   configuration:     restic:       enable: true     velero:       podConfig:         env:           - name: dpa             value: veleropod       defaultPlugins:         - openshift         - aws       # oc get po velero-54cf6b666f-2fvht -n openshift-adp -o jsonpath= '{.spec.containers[*].env}' | jq [   {     "name" : "VELERO_SCRATCH_DIR" ,     "value" : "/scratch"   },   {     "name" : "VELERO_NAMESPACE" ,     "valueFrom" : {       "fieldRef" : {         "apiVersion" : "v1" ,         "fieldPath" : "metadata.namespace"       }     }   },   {     "name" : "LD_LIBRARY_PATH" ,     "value" : "/plugins"   },   {     "name" : "dpa" ,     "value" : "veleropod"   },   {     "name" : "OPENSHIFT_IMAGESTREAM_BACKUP" ,     "value" : " true "   } ]     Test env variable in restic pod -     kind: DataProtectionApplication metadata:   namespace: openshift-adp   name: sqlcheck spec:   backupLocations:   - velero:       provider: aws       default : true       objectStorage:         bucket: ocp-aws-bucket         prefix: 'velero'       config:         profile: ' default '         region: us-east-1       credential:         name: cloud-credentials         key: cloud   configuration:     restic:       podConfig:         env:           - name: dpa             value: Resticpod       enable: true     velero:       defaultPlugins:         - openshift         - aws       # oc get po restic-mj8s6 -n openshift-adp -o jsonpath= '{.spec.containers[*].env}' | jq [   {     "name" : "NODE_NAME" ,     "valueFrom" : {       "fieldRef" : {         "apiVersion" : "v1" ,         "fieldPath" : "spec.nodeName"       }     }   },   {     "name" : "VELERO_NAMESPACE" ,     "valueFrom" : {       "fieldRef" : {         "apiVersion" : "v1" ,         "fieldPath" : "metadata.namespace"       }     }   },   {     "name" : "VELERO_SCRATCH_DIR" ,     "value" : "/scratch"   },   {     "name" : "dpa" ,     "value" : "Resticpod"   } ]   Marking as verified.    

              sgarudi Sonia Garudi
              mperetz@redhat.com Maya Peretz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: