mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Add integration tests highlighting our expectations * Bump Devfile library to latest commitf041d79870* Expose preference that allows users to globally configure an image registry * Return the effective Devfile view by default from the initial context This is supposed to be read-only, so that tools can rely on it and to the operations they need to perform right away. Raw Devfile objects can still be obtained upon request if there is need to update them (for example via 'odo add/remove binding' commands. * Pass the image registry preference to the Devfile parser to build the effective view * Fix 'odo init' integration tests - The test spec was actually not doing what it was supposed to do - Now 'odo init' returns a complete Devfile, where the parent is flattened, because the goal of 'odo init' is to bootstrap a Devfile. Previously, 'odo init' would not download the parent referenced, making it hard to understand the resulting Devfile. * Document how odo now handles relative image names as selectors * fixup! Document how odo now handles relative image names as selectors Co-authored-by: Philippe Martin <phmartin@redhat.com> * Revert "Fix 'odo init' integration tests" This reverts commit78868b03fd. Co-authored-by: Philippe Martin <phmartin@redhat.com> * Do not make `odo init` return an effective Devfile as a result This would change the behavior of `odo init`. Furthermore, due to an issue [1] in the Devfile library, it is not possible to parse some Devfiles with parents linked as GitHub URLs (like GitHub release artifacts). [1] https://github.com/devfile/api/issues/1119 Co-authored-by: Philippe Martin <phmartin@redhat.com> * fixup! Document how odo now handles relative image names as selectors --------- Co-authored-by: Philippe Martin <phmartin@redhat.com>
3.6 KiB
3.6 KiB
Id and Name:
^[a-z0-9]([-a-z0-9]*[a-z0-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.
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.
- limit to lowercase characters i.e., no uppercase allowed
- limit within 63 characters
- no special characters allowed except dash(-)
- start with an alphanumeric character
- end with an alphanumeric character
Endpoints:
- all the endpoint names are unique across components
- 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
dedicatedPodset totrue.
Commands:
- id must be unique
- composite command:
- Should not reference itself via a subcommand
- Should not indirectly reference itself via a subcommand which is a composite command
- Should reference a valid devfile command
- exec command should: map to a valid container component
- apply command should: map to a valid container/kubernetes/openshift/image component
{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.
Components:
Common rules for all components types:
- Name must be unique
Container component
- the container components must reference a valid volume component if it uses volume mounts, and the volume components are unique
PROJECT_SOURCEorPROJECTS_ROOTare reserved environment variables defined under env, cannot be defined again inenv- the annotations should not have conflict values for same key, except deployment annotations and service annotations set for a container with
dedicatedPod=true - 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).
Plugin Component
- Commands in plugins components share the same commands validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
- Registry URL needs to be in valid format
Kubernetes & Openshift component
- URI needs to be in valid URI format
Image component
- 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
Events:
- preStart and postStop events can only be Apply commands
- postStart and preStop events can only be Exec commands
- if preStart and postStop events refer to a composite command, then all containing commands need to be Apply commands.
- if postStart and preStop events refer to a composite command, then all containing commands need to be Exec commands.
Parent:
- Share the same validation rules as listed above. Validation occurs after overriding and merging, in flattened devfile
starterProjects:
- Starter project entries cannot have more than one remote defined
- if checkout remote is mentioned, validate it against the starter project remote configured map
projects
- if more than one remote is configured, a checkout remote is mandatory
- if checkout remote is mentioned, validate it against the starter project remote configured map