Refering to a parent devfile in a devfile
It is possible to refer to another devfile as a parent to a given devfile. If a parent is specified, the devfile will inherit all behaviour from the parent. Part of the content of the parent can be overridden in the child devfile. That allows refering a devfile (the parent) from a distinct devfile and makes it possible to reuse in multiple devfiles the same parent (the stack).
Prerequisites
Procedure
-
A parent devfile can be referenced in 3 different ways:
registry
,uri
orkubernetes
.Example 1. Parent referred by registryUsing its
id
if it has been published in a registry.schemaVersion: 2.0.0 metadata: name: my-project-dev parent: id: redhat/nodejs/11.6 registry: https://devfile-registry.io/
Example 2. Parent referred by uriUsing the URI if it has been published on a static http server (like gist or pastebin).
schemaVersion: 2.0.0 metadata: name: my-project-dev parent: id: redhat/nodejs/11.6 uri: https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/nodejs/devfile.yaml
Example 3. Parent identified by a Kubernetes resourceUsing a Kubernetes resource name, namespace and selector if it has been deployed on a Kubernete cluster.
schemaVersion: 2.0.0 metadata: name: my-project-dev parent: kubernetes: name: mydevworkspacetemplate namespace: mynamespace selector: mykey=myvalue
Additional resources