Adding plugin
component to a devfile
This section describes how to add a plugin
component to a devfile.
Prerequisites
Procedure
-
Define a component using the type
plugin
. -
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-inid
components: - name: exec-plugin plugin: id: machine-exec-plugin/0.0.1
-
Optionally, specify an alternative component registry using the
registryUrl
parameter:Example 2. A devfile defining a plug-inid
and an alternative component registrycomponents: - name: exec-plugin plugin: id: machine-exec-plugin/0.0.1 registryUrl: https://my-customregistry.com
-
Optionally, provide a direct link to the component descriptor (typically named
meta.yaml
) using thereference
attribute, instead of using theid
.Example 3. A devfile defining a plug-in with a direct link to the component descriptorcomponents: - name: exec-plugin plugin: reference: https://raw.githubusercontent.com.../plugin/1.0.1/meta.yaml
It is impossible to mix the id
andreference
fields in a single component definition; they are mutually exclusive. -
Optionally, provide plugin component configuration using the
preferences
attributeExample 4. Configuring JVM using plug-in preferencesid: 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