Skip to content

Commit 3fe5096

Browse files
yangcao77elsony
authored andcommitted
modify the doc based on suggestion
Signed-off-by: Stephanie <[email protected]>
1 parent 626dd91 commit 3fe5096

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

pkg/validation/validation-rule.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Id and Name:
22
`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
33

4-
The restriction is added to allow easy translation to K8 resource names, and also to have consistent rules for both name and id fields
4+
The restriction is added to allow easy translation to K8s resource names, and also to have consistent rules for both name and id fields
55
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.
66

77
- limit to lowercase characters i.e.; no uppercase allowed
@@ -14,7 +14,7 @@ The validation will be done as part of schema validation, the rule will be intro
1414

1515
### Endpoints:
1616
- all the endpoint names are unique across components
17-
Since network is shared in the same pod, endpoint ports should be unique across components, two components cannot have the same target port but two endpoints in a single component can have the same target port. only exception: container component with `dedicatedpod=true`
17+
Since network is shared in the same pod, endpoint ports should be unique across components, two components cannot have the same target port but two endpoints in a single component can have the same target port. Only exception: container component with `dedicatedpod=true`
1818

1919
### Commands:
2020
1. Id must be unique
@@ -25,18 +25,22 @@ Since network is shared in the same pod, endpoint ports should be unique across
2525
- Subcommands should be valid as well
2626
3. exec command should:
2727
map to a valid container component
28-
4. vscodeLaunch & vscodeTask: uri needs to be in valid uri form
29-
5. `{build, run, test, debug}`, 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.
30-
28+
4. vscodeLaunch & vscodeTask: URI needs to be in valid URI format
29+
5. `{build, run, test, debug}`, 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.
3130

3231
### Components:
33-
1. name must be unique
34-
2. Container component:
35-
the container components must reference a valid volume component if it uses volume mounts, and the volume components are unique
36-
PROJECT_SOURCE or PROJECTS_ROOT are reserved Env, cannot be defined again in Env
37-
3. Plugin Component:
38-
Commands and components share the same validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
39-
1. Kubernetes & Openshift component: uri needs to be in valid uri format
32+
Common rules for all components types:
33+
- Name must be unique
34+
35+
#### Container component
36+
1. the container components must reference a valid volume component if it uses volume mounts, and the volume components are unique
37+
2. `PROJECT_SOURCE` or `PROJECTS_ROOT` are reserved Env, cannot be defined again in Env
38+
39+
#### Plugin Component
40+
- Commands in plugins components share the same commands validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
41+
42+
#### Kubernetes & Openshift component
43+
- URI needs to be in valid URI format
4044

4145

4246
### Events:
@@ -47,8 +51,8 @@ Commands and components share the same validation rules as listed above. Validat
4751

4852

4953
### Parent:
50-
Share the same validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
54+
- Share the same validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
5155

5256

5357
### starterProjects:
54-
Starter project entries cannot have more than one remotes defined
58+
- Starter project entries cannot have more than one remotes defined

0 commit comments

Comments
 (0)