kind: DevWorkspaceTemplate
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: remote-runtime-injector
  annotations:
    controller.devfile.io/allow-import-from: '*'
spec:
  components:
    - name: remote-runtime-injector
      attributes:
        "app.kubernetes.io/part-of": che-theia.eclipse.org
        "app.kubernetes.io/component": bootstrapper
      container:                          #### corresponds to `initContainer` definition in old meta.yaml.
        image: "quay.io/eclipse/che-theia-endpoint-runtime-binary:7.20.0"
        volumeMounts:
          - path: "/remote-endpoint"
            name: remote-endpoint
        env:
          - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
            value: /remote-endpoint/plugin-remote-endpoint
          - name: REMOTE_ENDPOINT_VOLUME_NAME
            value: remote-endpoint
  commands:
    - id: inject-theia-in-remote-sidecar
      apply:
        component: remote-runtime-injector
  events:
    preStart:
      - inject-theia-in-remote-sidecar
