Adding plugin component to a devfile

This section describes how to add a plugin component to a devfile.

Procedure
  1. Define a component using the type plugin.

  2. Define the id attribute. It is slash-separated publisher, name and version of plug-in from the Plug-in registry. List of available Devfile plug-ins and more information about registry can be found in the Devfile plug-in registry GitHub repository.

    Example 1. A devfile defining a plug-in id
      components:
       - name: exec-plugin
         plugin:
          id: machine-exec-plugin/0.0.1
  3. Optionally, specify an alternative component registry using the registryUrl parameter:

    Example 2. A devfile defining a plug-in id and an alternative component registry
      components:
       - name: exec-plugin
         plugin:
          id: machine-exec-plugin/0.0.1
          registryUrl: https://my-customregistry.com
  4. Optionally, provide a direct link to the component descriptor (typically named meta.yaml) using the reference attribute, instead of using the id.

    Example 3. A devfile defining a plug-in with a direct link to the component descriptor
      components:
       - name: exec-plugin
         plugin:
          reference: https://raw.githubusercontent.com.../plugin/1.0.1/meta.yaml
    It is impossible to mix the id and reference fields in a single component definition; they are mutually exclusive.
  5. Optionally, provide plugin component configuration using the preferences attribute

    Example 4. Configuring JVM using plug-in preferences
      id: redhat/java/0.38.0
      plugin:
        preferences:
           java.jdt.ls.vmargs: '-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication'
    Example 5. Configuring preferences as an array:
      id: redhat/java/0.38.0
      plugin:
        preferences:
          go.lintFlags: ["--enable-all", "--new"]
Additional resources