-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
area/ipceiImportant Project of Common European InterestImportant Project of Common European Interestkind/tasksmall task, normally part of feature or epicsmall task, normally part of feature or epic
Milestone
Description
Context
Dry run mode in ocm add componentversions --dry-run does not validate schema.
Version
v0.341
To Reproduce
Steps to reproduce the behavior:
- Create example
component-constructor.yamlwith one reference using incorrect semantic version:
components:
- name: example.com/dryrun
version: 0.0.1
provider:
name: example
resources:
- name: image-clamav-simple
type: ociImage
version: "1.4.2-38_base"
access:
type: ociArtifact
imageReference: registry-1.docker.io/clamav/clamav:1.4.2-38_base@sha256:e7d108f30ea8f16935dbd12e4b58665f1bc148ce3dd59028cf04088330216910
- Run
ocm add componentversions --dry-run
> ocm add componentversions --dry-run --create --file ./ctf component-constructor.yaml
processing component-constructor.yaml...
processing document 1...
processing index 1
found 1 component
---
name: example.com/dryrun
provider:
name: example
resources:
- access:
imageReference: registry-1.docker.io/clamav/clamav:1.4.2-38_base@sha256:e7d108f30ea8f16935dbd12e4b58665f1bc148ce3dd59028cf04088330216910
type: ociArtifact
name: image-clamav-simple
type: ociImage
version: 1.4.2-38_base
version: 0.0.1
- Run
ocm add componentversionswithout--dry-run
> ocm add componentversions --create --file ./ctf component-constructor.yaml
processing component-constructor.yaml...
processing document 1...
processing index 1
found 1 component
adding component example.com/dryrun:0.0.1...
adding resource ociImage: "name"="image-clamav-simple","version"="1.4.2-38_base"...
Error: failed adding component "example.com/dryrun"(component-constructor.yaml[1][1]): component.resources: Must validate one and only one schema (oneOf);component.resources.0.version: Does not match pattern '^[v]?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
Actual behavior
ocm add componentversions --dry-runexits without returning errorocm add componentversionswithout--dry-runreturns error
Expected behavior
ocm add componentversions --dry-runreturns errorocm add componentversionswithout--dry-runreturns error
Screenshots (optional)
If applicable, add screenshots to help explain your problem.
Environment
- windows
- linux
- mac
Additional Comments
According to @jakobmoellerdev :
We probably check for the constructor schema too late after dry run exits.
sk31337
Metadata
Metadata
Assignees
Labels
area/ipceiImportant Project of Common European InterestImportant Project of Common European Interestkind/tasksmall task, normally part of feature or epicsmall task, normally part of feature or epic
Type
Projects
Status
📋 Next-UP