Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation fails on devfile with component/container annotation #675

Closed
feloy opened this issue Nov 12, 2021 · 1 comment · Fixed by devfile/library#123
Closed

Validation fails on devfile with component/container annotation #675

feloy opened this issue Nov 12, 2021 · 1 comment · Fixed by devfile/library#123
Assignees
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working
Projects

Comments

@feloy
Copy link
Contributor

feloy commented Nov 12, 2021

/kind bug

Which area this bug is related to?

/area library

What versions of software are you using?

Operating System:

Linux Fedora

Go Pkg Version:

Bug Summary

Describe the bug:

When saving a devfile using a recent devfile/api library, an empty annotation is added to the container components:

components:
- container:
    annotation: {}
    endpoints:
    - name: http-3000
      targetPort: 3000
    image: registry.access.redhat.com/ubi8/nodejs-14:latest
    memoryLimit: 1024Mi
    mountSources: true
    sourceMapping: /project
  name: runtime

When trying to validate this devfile with the devfile/library package, this error occurs:

 ✗  invalid devfile schema. errors :
- components.0.container: Additional property annotation is not allowed

To Reproduce:

Expected behavior

Additional context

Suggestion on how to fix the bug

The schemas of the different devfile revisions should be modified to authorize the annotation field:

@openshift-ci openshift-ci bot added kind/bug Something isn't working area/library Common devfile library for interacting with devfiles labels Nov 12, 2021
@yangcao77 yangcao77 self-assigned this Nov 15, 2021
@yangcao77
Copy link
Contributor

yangcao77 commented Nov 15, 2021

The issue will be fixed by devfile/library#123

Suggestion on how to fix the bug

The schemas of the different devfile revisions should be modified to authorize the annotation field:

https://github.com/devfile/library/blob/main/pkg/devfile/parser/data/v2/2.0.0/devfileJsonSchema200.go
https://github.com/devfile/library/blob/main/pkg/devfile/parser/data/v2/2.1.0/devfileJsonSchema210.go

https://github.com/devfile/library/blob/main/pkg/devfile/parser/data/v2/2.2.0/devfileJsonSchema220.go

and to clarify: the annotation is a new field introduced in devfile 2.2.0, we are not going to go back to support the annotation for devfile 200 or 210.

@yangcao77 yangcao77 added this to Under consideration in Sprint 209 via automation Nov 15, 2021
@yangcao77 yangcao77 moved this from Under consideration to Review in progress in Sprint 209 Nov 15, 2021
@johnmcollier johnmcollier added this to Under consideration in Sprint 210 via automation Nov 16, 2021
@johnmcollier johnmcollier removed this from Review in progress in Sprint 209 Nov 16, 2021
@johnmcollier johnmcollier moved this from Under consideration to Review in progress in Sprint 210 Nov 16, 2021
Sprint 210 automation moved this from Review in progress to Done Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants