Skip to content

Implicitly set merge-contribution:true on first template component #993

@l0rd

Description

@l0rd

The problem

Currently both a contribution and the attribute controller.devfile.io/merge-contribution: true are required to properly "inject" an IDE in workspace Pod:

kind: DevWorkspace
(...)
spec:
  contributions:
    - name: editor
      kubernetes:
        name: che-code 
  template:
    components:
      - name: tooling-container
        attributes:
          controller.devfile.io/merge-contribution: true

Considered that:

  • most of the time the template only has one container component or, if there are more than one, the developer wants to use the first container as the dev tooling container.
  • the merge-contribution attribute makes sense in a Che scenario but not in odo or dev console scenarios (yet) so we should not specify it in registry.devfile.io.
  • we want the devworkspace template to match the original devfile so it's easier to update it if the original devfile is updated.

we should define a convention to apply contributions when that's not explicitly specified in the template/devfile.

A proposal

  • opt-in to contribution is implicit: when no component has a merge-contribution attribute, the contribution should be applied to the first container component.
  • out-out to contribution is explicit: the author or a devfile should explicitly set merge-contribution to false to avoid contributions to that component.
  • a devfile with multiple merge-contributions: true is invalid: the devworkspace controller should return an error if multiple components have merge-contribution explicitly set to true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions