Repository navigation
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.
View guided diff | Re-trigger cubic
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
9cd931c to
4421396
Compare
briankane
left a comment
There was a problem hiding this comment.
Thanks a million @Skarlso, it's great to see OCM land here, and the definitions line up nicely with the 0.23.0 CRDs. The health and status policies behave as I'd hope too (I ran them against a few fake statuses).
One blocker, I'm afraid. The error() guards in parameter.cue break vela addon enable on KubeVela 1.11. Before installing, the addon loader turns parameter.cue into an OpenAPI schema, and on 1.11 the CUE OpenAPI encoder can't handle error():
components.schemas.parameter.properties.values.properties.nameOverride.enum.0: nameOverride is not supported: ...
I checked on a 1.11.2 cluster and the enable stops before anything is installed. Your guard is the right idea, so that's on us: kubevela/kubevela#7679 is to treat error() fields as forbidden in the schema and never let the schema block an enable, backported to 1.11. Until that ships, the addon says >=v1.11.0, so it has to work on today's 1.11. Heads up that the catalog CI only enables changed addons under addons/, so it never ran this one, which is why it's green. Inline there's a version that forces fullnameOverride instead. With that, nameOverride is harmless, and I checked it generates on both 1.11 and master. Once kubevela/kubevela#7679 is out you could go back to error() if you prefer it.
On your two replies to cubic: agreed on both. additionalStatusFields is free JSON in the CRD, and pinning the release name is the right call. On 1.11 the helmchart health check needs name set anyway, since it errors without one (fixed on master).
A few smaller things:
- Could you open an issue for the addon and link the discussion? It's how we track new addons.
- The addon version is the toolkit version, so how would you ship an addon-only fix? I'd be grand with the addon having its own version, or
0.23.0-1style, whatever you prefer, as long as we agree it up front. cue fmtwants a couple of whitespace tweaks inocm-resource.cueandcontroller.cue.
Happy to approve once the parameter fix is in. Thanks again, really nice addition.
| values?: { | ||
| // Both rename the controller Deployment, which the addon health check looks up by name. | ||
| nameOverride?: error("nameOverride is not supported: the addon health check needs the default Deployment name") | ||
| fullnameOverride?: error("fullnameOverride is not supported: the addon health check needs the default Deployment name") | ||
| ... | ||
| } |
There was a problem hiding this comment.
On KubeVela 1.11 the addon loader generates an OpenAPI schema from this file before enabling, and the encoder fails on error(), so vela addon enable stops with fail to generate openAPIschema. How about forcing the name rather than rejecting the field? Something like:
values?: {
// The addon health check looks the controller Deployment up by this name.
fullnameOverride?: "ocm-k8s-toolkit"
...
}With fullnameOverride always set (see controller.cue), the Deployment is ocm-k8s-toolkit-controller-manager whatever nameOverride says, so that one can go through.
| if parameter.values != _|_ { | ||
| values: parameter.values | ||
| } |
There was a problem hiding this comment.
Pairs with the parameter.cue change:
values: {
if parameter.values != _|_ {
parameter.values
}
fullnameOverride: "ocm-k8s-toolkit"
}| // I needed to add this for the health reporting to work properly once the release is applied. | ||
| // The name was needed because vela 1.11.1 did not use the match criteria without this being set. |
There was a problem hiding this comment.
Small one: could this say the rule rather than the history? e.g. "KubeVela 1.11's helmchart health check needs the resource name; the release name is fixed so this one is stable."
| @@ -0,0 +1,16 @@ | |||
| name: open-component-model | |||
| version: 0.23.0 | |||
There was a problem hiding this comment.
Since this is the toolkit version, what would an addon-only fix bump to? Fine by me to decouple it, just want to agree it before the first release.
| // +usage=Whether to verify the resource digest | ||
| verificationPolicy: *"Always" | "Never" | ||
| // +usage=CEL expressions evaluated against the resource, published under status.additional, for example {image: "resource.access.imageReference"} | ||
| additionalStatusFields?: {...} |
There was a problem hiding this comment.
Agree with your reply to cubic, the CRD takes free JSON. If you fancy it, [string]: string matches how it's used (CEL strings) and gives VelaUX a nicer form. Not a blocker.
| // +usage=How often the repository is checked for new component versions | ||
| interval: *"10m" | string | ||
| // +usage=References to secrets or config maps with OCM configuration, such as credentials | ||
| ocmConfig?: [...{...}] |
There was a problem hiding this comment.
Optional: typing this as [...{kind: "Secret" | "ConfigMap" | ..., name: string, apiVersion?: string, namespace?: string, policy?: *"Propagate" | "DoNotPropagate"}] would show the shape in vela show and VelaUX.
|
@briankane nice, thanks so much Brian! :) I will address these comments! :) |
|
@briankane hey Brian. I created the issue, just unsure if it's at the right location. :) Please tell me if I should move it to kubevela/kubevela instead. :) |
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Good call! I versioned it 0.1.0 in the end if that's okay. :) |
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
8a3dfd7 to
ea45fda
Compare
Description of your changes
Hello! We at https://ocm.software find Vela a perfect fit for our ecosystem and would like to integrate with it as much as we can. :) There is a discussion about Vela + OCM + other tools that do life-cycle management and work in the same general area of delivering and running software.
OCM sits at the front. It has the ability to package and transfer components for Vela to work with!
We would like to add this experimental extension and see how the community can work with it. :)
Here is the discussion: kubevela/kubevela#7522 where you can read more.
Thanks!
Fixes #822
How has this code been tested?
I created a kind cluster, installed vela and then run what the README said. Checked health status and ran the README demo with ocm-k8s-toolkit 0.23.0.
Checklist
I have:
[Addon],[example]or[Doc]).versioninmetadata.yamlto generate a new version.Verified Addon promotion rules
If this pr wants to promote an experimental addon to verified, you must check whether meet these conditions too:
metadata.yaml.README.md.Summary by cubic
Adds an experimental
open-component-modeladdon that makes Open Component Model (OCM) component versions consumable as KubeVela deliverables.ocm-componentandocm-resourcecomponent definitions that resolve component versions and their verified, digest-pinned resources.helmchartcomponent.Written for commit ea45fda. Summary will update on new commits.