name: "Resolve parent by Kubernetes reference"

input:
  devworkspace:
    parent:
      kubernetes:
        name: test-parent-k8s
      components:
        - name: parent-component
          container:
            env:
              - name: test-env
                value: test-value
    components:
      - name: regular-component
        container:
          image: regular-test-image
          name: regular-container
  devworkspaceResources:
    test-parent-k8s:
      kind: DevWorkspaceTemplate
      apiVersion: workspace.devfile.io/v1alpha2
      metadata:
        name: parent-devworkspacetemplate
        annotations:
          "controller.devfile.io/allow-import-from": "*"
      spec:
        components:
          - name: parent-component
            container:
              image: test-img
              env:
                - name: test-env
                  value: original-value

output:
  devworkspace:
    components:
      - name: parent-component
        attributes:
          controller.devfile.io/imported-by: parent
        container:
          image: test-img
          env:
            - name: test-env
              value: test-value
      - name: regular-component
        container:
          image: regular-test-image
          name: regular-container
