Skip to content

Commit 5bf2f9b

Browse files
committed
address review comments
Signed-off-by: Stephanie <[email protected]>
1 parent a330829 commit 5bf2f9b

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
11
---
2-
title: Devfile Validation Rules
3-
description: Devfile Validation Rules
2+
title: Devfile validation rules
3+
description: Devfile validation rules
44
---
55

6-
### Id and Name:
6+
## Id and Name:
77
`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
88

9-
The restriction is added to allow easy translation to K8s resource names, and also to have consistent rules for both name and id fields.
9+
The restriction is added to allow easy translation to K8s resource names, and also to have consistent rules for both `name` and `id` fields.
1010

1111
The validation will be done as part of schema validation, the rule will be introduced as a regex in schema definition, any objection of the rule in devfile will result in a failure.
1212

13-
- limit to lowercase characters i.e., no uppercase allowed
14-
- limit within 63 characters
15-
- no special characters allowed except dash(-)
16-
- start with an alphanumeric character
17-
- end with an alphanumeric character
13+
- Limit to lowercase characters i.e., no uppercase allowed
14+
- Limit within 63 characters
15+
- No special characters allowed except dash(-)
16+
- Start with an alphanumeric character
17+
- End with an alphanumeric character
1818

1919

20-
### Endpoints:
21-
- all the endpoint names are unique across components
22-
- endpoint ports must be unique across container components -- two container components cannot have the same target port, but one container component may have two endpoints with the same target port. This restriction does not apply to container components with `dedicatedPod` set to `true`.
20+
## Endpoints:
21+
- All the endpoint names are unique across components
22+
- Endpoint ports must be unique across container components -- two container components cannot have the same target port, but one container component may have two endpoints with the same target port. This restriction does not apply to container components with `dedicatedPod` set to `true`.
2323

2424

25-
### Commands:
26-
1. id must be unique
25+
## Commands:
26+
1. `id` must be unique
2727
2. composite command:
2828
- Should not reference itself via a subcommand
2929
- Should not indirectly reference itself via a subcommand which is a composite command
3030
- Should reference a valid devfile command
31-
3. exec command should: map to a valid container component
32-
4. apply command should: map to a valid container/kubernetes/openshift/image component
31+
3. `exec` command should: map to a valid container component
32+
4. `apply` command should: map to a valid container/kubernetes/openshift/image component
3333
5. `{build, run, test, debug, deploy}`, each kind of group can only have one default command associated with it. If there are multiple commands of the same kind without a default, a warning will be displayed.
3434

35-
### Components:
35+
## Components:
3636
Common rules for all components types:
37-
- Name must be unique
37+
- `name` must be unique
3838

39-
#### Container component
40-
1. the container components must reference a valid volume component if it uses volume mounts, and the volume components are unique
39+
### Container component
40+
1. The container components must reference a valid volume component if it uses volume mounts, and the volume components are unique
4141
2. `PROJECT_SOURCE` or `PROJECTS_ROOT` are reserved environment variables defined under env, cannot be defined again in `env`
42-
3. the annotations should not have conflict values for same key, except deployment annotations and service annotations set for a container with `dedicatedPod=true`
43-
4. resource requirements, e.g. `cpuLimit`, `cpuRequest`, `memoryLimit`, `memoryRequest`, must be in valid quantity format; and the resource requested must be less than the resource limit (if specified).
42+
3. The annotations should not have conflict values for same key, except deployment annotations and service annotations set for a container with `dedicatedPod=true`
43+
4. Resource requirements, e.g. `cpuLimit`, `cpuRequest`, `memoryLimit`, `memoryRequest`, must be in valid quantity format; and the resource requested must be less than the resource limit (if specified).
4444

45-
#### Plugin Component
45+
### Plugin Component
4646
- Commands in plugins components share the same commands validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
4747
- Registry URL needs to be in valid format
4848

49-
#### Kubernetes & Openshift component
50-
- URI needs to be in valid URI format
49+
### Kubernetes & Openshift component
50+
- `uri` needs to be a valid URI format
5151

52-
#### Image component
53-
- A Dockerfile Image component's git source cannot have more than one remote defined. If checkout remote is mentioned, validate it against the remote configured map
52+
### Image component
53+
- An `image` component's git source cannot have more than one remote defined. If checkout remote is mentioned, validate it against the remote configured map
5454

5555

56-
### Events:
57-
1. preStart and postStop events can only be Apply commands
58-
2. postStart and preStop events can only be Exec commands
59-
3. if preStart and postStop events refer to a composite command, then all containing commands need to be Apply commands.
60-
4. if postStart and preStop events refer to a composite command, then all containing commands need to be Exec commands.
56+
## Events:
57+
1. `preStart` and `postStop` events can only be `apply` commands
58+
2. `postStart` and `preStop` events can only be `exec` commands
59+
3. If `preStart` and `postStop` events refer to a composite command, then all containing commands need to be `apply` commands.
60+
4. If `postStart` and `preStop` events refer to a composite command, then all containing commands need to be `exec` commands.
6161

6262

63-
### Parent:
63+
## Parent:
6464
- Share the same validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
6565

6666

67-
### starterProjects:
67+
## starterProjects:
6868
- Starter project entries cannot have more than one remote defined
69-
- if checkout remote is mentioned, validate it against the starter project remote configured map
69+
- If `checkoutFrom.remote` is mentioned, validate it against the starter project remote configured map
7070

71-
### projects
72-
- if more than one remote is configured, a checkout remote is mandatory
73-
- if checkout remote is mentioned, validate it against the starter project remote configured map
71+
## projects
72+
- If more than one remote is configured, a checkout remote is mandatory
73+
- If checkout remote is mentioned, validate it against the starter project remote configured map

0 commit comments

Comments
 (0)