name: "Handle mountSources correctly"

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: "/testdir1"
        # no mountSources defined -> should mount sources
    - name: testing-container-2
      container:
        image: testing-image-2
        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
        # No sourceMapping -> defaults to "/projects"
        mountSources: true # mountSources: true -> should mount sources
    - name: testing-container-3
      container:
        image: testing-image-3
        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: "/projects"
        mountSources: false # mountSources: false -> should not mount sources
output:
  podAdditions:
    containers:
      - name: testing-container-1
        image: testing-image-1
        imagePullPolicy: Always
        resources:
          requests:
            memory: "-1"
            cpu: "-1"
          limits:
            memory: "-1"
            cpu: "-1"
        volumeMounts:
          - name: "projects"
            mountPath: "/testdir1"
        env:
          - name: "DEVWORKSPACE_COMPONENT_NAME"
            value: "testing-container-1"
          - name: "PROJECTS_ROOT"
            value: "/testdir1"
          - name: "PROJECTS_SOURCE"
            value: "/testdir1" # Temp value until projects is figured out
      - name: testing-container-2
        image: testing-image-2
        imagePullPolicy: Always
        resources:
          requests:
            memory: "-1"
            cpu: "-1"
          limits:
            memory: "-1"
            cpu: "-1"
        volumeMounts:
          - name: "projects"
            mountPath: "/projects"
        env:
          - name: "DEVWORKSPACE_COMPONENT_NAME"
            value: "testing-container-2"
          - name: "PROJECTS_ROOT"
            value: "/projects"
          - name: "PROJECTS_SOURCE"
            value: "/projects" # Temp value until projects is figured out

      - name: testing-container-3
        image: testing-image-3
        imagePullPolicy: Always
        env:
          - name: "DEVWORKSPACE_COMPONENT_NAME"
            value: "testing-container-3"
        resources:
          requests:
            memory: "-1"
            cpu: "-1"
          limits:
            memory: "-1"
            cpu: "-1"
