Skip to content

Validation fails on devfile with component/container annotation #675

Closed
devfile/library
#123

Description

@feloy

/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:

Activity

  1. added
    kind/bug
    area/library
    on Nov 12, 2021
  2. self-assigned this
    on Nov 15, 2021
  3. yangcao77 commented on Nov 15, 2021

    @yangcao77
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/librarykind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions