Adding a name to a devfile

Adding a name to a devfile is mandatory. Use the name or generateName attributes (or both) to define the name.

Procedure
  1. To specify a static name for the workspace, define the name attribute.

    Adding a static name to a devfile
    schemaVersion: 2.1.0
    metadata:
      name: devfile-sample
      version: 2.0.0
  2. To specify a prefix for automatically generated workspace names, define the generateName attribute and not the name attribute.

    • The workspace name is in the <generateName>YYYYY format, for example, devfile-sample-2y7kp. Y is a random charater, [a-z0-9].

      Adding a generated name to a devfile
      schemaVersion: 2.1.0
      metadata:
        generateName: devfile-sample
        version: 2.0.0
Defining name or generateName has the same effect when creating workspaces using a factory. The value forms the name prefix: <name>YYYYY or <generateName>YYYYY. When defining both generateName and name, generateName takes precedence.
Additional resources