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

Cannot add references in component-constructor.yaml file as part of component version specification #1041

Closed
jakobmoellerdev opened this issue Nov 4, 2024 · 6 comments · Fixed by #1054
Assignees
Labels
area/ipcei Important Project of Common European Interest kind/bugfix Bug

Comments

@jakobmoellerdev
Copy link
Contributor

What happened:

Try to use a component-constructor.yaml as such:

components:
  - name: github.com/jakobmoellerdev/testcomponent
    version: 1.0.0
    provider:
      name: github.com/jakobmoellerdev
    resources:
      - name: image
        type: ociImage
        version: "1.0"
        access:
          type: ociArtifact
          imageReference: gcr.io/google-containers/echoserver:1.10
    references:
      - name: installer
        componentName: github.com/jakobmoellerdev/toi/installers/helminstaller
        version: 1.0.0

Then we try to establish the componentversion as such:

ocm add componentversions --create --file ./ctf component-constructor.yaml

we then get the following issue:

processing component-constructor.yaml...
  processing document 1...
    processing index 1
Error: component-constructor.yaml: invalid component spec 1[1]: references: Forbidden: unknown field

What you expected to happen:

A successfully added component version

How to reproduce it (as minimally and precisely as possible):

  1. attempt to add references as described in https://github.com/open-component-model/ocm-spec/blob/main/doc/01-model/02-elements-toplevel.md#references as part of a component version via component-constructor.

Anything else we need to know:

Environment:

ocm version
{"Major":"0", "Minor":"17", "Patch":"0", "PreRelease":"dev", "Meta":"0d76b3cf563e50cbbf178d213ea9e45ceef40d21", "GitVersion":"0.17.0-dev+0d76b3cf563e50cbbf178d213ea9e45ceef40d21", "GitCommit":"0d76b3cf563e50cbbf178d213ea9e45ceef40d21", "GitTreeState":"dirty", "BuildDate":"2024-10-30T14:56:17+0000", "GoVersion":"go1.23.2", "Compiler":"gc", "Platform":"darwin/arm64"}
@github-actions github-actions bot added the area/ipcei Important Project of Common European Interest label Nov 4, 2024
@morri-son
Copy link
Contributor

@jakobmoellerdev shouldn't it be componentReferences instead of references?

@jakobmoellerdev
Copy link
Contributor Author

Then the spec is wrong I believe, as I linked it it should be "references"

@jakobmoellerdev
Copy link
Contributor Author

Also in the resources.yaml its called "references" not componentReferences. mabye an inconsistency?

@morri-son
Copy link
Contributor

I guess it should indeed be componentReferences and we have inconsistencies: https://github.com/search?q=repo%3Aopen-component-model%2Focm-spec+componentreferences%3A&type=code. I can see that references is also used in the status of the ComponentVersion CRD.

@fabianburth @mandelsoft , can you please check and confirm that references to other components in all places, resource/constructor yaml, component version, status etc should be componentReferences instead of references ?

@morri-son
Copy link
Contributor

I talked to Uwe and indeed there is a difference between v2 and v3, where in v2 componentReferences and in v3 references is used. The issue here is that in the constructor file only componentReferences is allowed. We should fix that and allow both. In addition to that we need to check the OCM spec for inconsistencies and also should pull open-component-model/ocm-project#262 into the next sprint (would also fit to our plan to get the CLI doc/website improved).

@fabianburth and @jakobmoellerdev for awareness

@morri-son
Copy link
Contributor

created follow up open-component-model/ocm-project#316 to correct the documentation.

@github-project-automation github-project-automation bot moved this from 🆕 ToDo to 🍺 Done in OCM Backlog Board Nov 6, 2024
@ocmbot ocmbot bot moved this from 🍺 Done to 🔒Closed in OCM Backlog Board Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei Important Project of Common European Interest kind/bugfix Bug
Projects
Status: 🔒Closed
Development

Successfully merging a pull request may close this issue.

3 participants