name: "Converts all applicable fields"

input:
  components:
    - name: testing-container-1
      container:
        image: testing-image-1
        memoryRequest: "-1"  # isolate test to not include this field
        memoryLimit: "-1"  # isolate test to not include this field
        cpuRequest: "-1"  # isolate test to not include this field
        cpuLimit: "-1"  # isolate test to not include this field
        sourceMapping: "/source-mapping"
        command: ["test", "command"]
        args: ["test", "args"]
        env:
          - name: "TEST_ENVVAR"
            value: "TEST_VALUE"
        endpoints:
          - name: "test-endpoint-1"
            exposure: public
            targetPort: 3100
            secure: true
            protocol: wss
            attributes:
              type: main
          - name: "test-endpoint-2"
            exposure: public
            targetPort: 8080
            secure: true
            protocol: http
            attributes:
        volumeMounts:
          - name: "test-volume1"
            path: "/test-volume1-path"
          - name: "test-volume2"
            # path omitted; should use name as mountpath
    - name: "should-be-ignored"
      volume: {}

output:
  podAdditions:
    containers:
      - name: testing-container-1
        image: testing-image-1
        imagePullPolicy: Always
        resources:
          requests:
            memory: "-1"
            cpu: "-1"
          limits:
            memory: "-1"
            cpu: "-1"
        env:
          - name: "DEVWORKSPACE_COMPONENT_NAME"
            value: "testing-container-1"
          - name: "TEST_ENVVAR"
            value: "TEST_VALUE"
          - name: "PROJECTS_ROOT"
            value: "/source-mapping"
          - name: "PROJECTS_SOURCE"
            value: "/source-mapping" # Temp value until projects is figured out
        command:
          - "test"
          - "command"
        args:
          - "test"
          - "args"
        ports:
          - name: "3100-wss"
            containerPort: 3100
            protocol: TCP
          - name: "8080-http"
            containerPort: 8080
            protocol: TCP
        volumeMounts:
          - name: "test-volume1"
            mountPath: "/test-volume1-path"
          - name: "test-volume2"
            mountPath: "/test-volume2"
          - name: "projects"
            mountPath: "/source-mapping"
