apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: storage-app
spec:
  components:
    - name: express-server
      type: webservice
      properties:
        image: crccheck/hello-world
        ports:
          - port: 8000
      traits:
        - type: storage
          properties:
            pvc:
              - name: test1
                mountPath: /test/mount/pvc
              - name: test1
                mountPath: /test/mount2/pvc
                subPath: /sub
            configMap:
              - name: test1
                mountPath: /test/mount/cm
                items:
                  - key: key1
                    path: keypath
                data:
                  key1: value1
                  key2: value2
              - name: test2
                mountPath: /test/mount2/cm
                mountToEnv:
                  envName: TEST_ENV
                  configMapKey: key1
                mountToEnvs:
                  - envName: TEST_CM_ENV
                    configMapKey: key2
                data:
                  key1: value1
                  key2: value2
            secret:
              - name: test1
                mountPath: /test/mount/secret
                items:
                  - key: key1
                    path: keypath
                stringData:
                  key1: value1
                  key2: value2
              - name: test2
                mountPath: /test/mount2/secret
                mountToEnv:
                  envName: TEST_SECRET
                  secretKey: key1
                mountToEnvs:
                  - envName: TEST_SECRET_ENV_2
                    secretKey: key2
                  - envName: TEST_SECRET_ENV_3
                    secretKey: key3
                data:
                  key1: dmFsdWUx
                  key2: dmFsdWUy
                  key3: dmFsdWUz
            emptyDir:
              - name: test1
                mountPath: /test/mount/emptydir
              - name: test2
                mountPath: /test/mount2/emptydir
