-
Notifications
You must be signed in to change notification settings - Fork 235
kro cli package command #617
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
base: main
Are you sure you want to change the base?
kro cli package command #617
Conversation
7e4d675
to
b52d281
Compare
b52d281
to
3ecac9c
Compare
I would add commands related to packaging under Maybe the PR description is wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im missing a test for this command
5bc227a
to
5db8280
Compare
} | ||
layer.Annotations[ocispec.AnnotationTitle] = filepath.Base(packageConfig.resourceGraphDefinitionFile) | ||
|
||
artifactType := "application/vnd.kro.resourcegraphdefinition" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be a global const that people can depend on.
Also probably needs a version (so we can change the format later)
packOpts := oras.PackManifestOptions{ | ||
Layers: []ocispec.Descriptor{layer}, | ||
ManifestAnnotations: map[string]string{ | ||
"kro.run/type": "resourcegraphdefinition", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the use of this type manifest annotation?
return fmt.Errorf("failed to create OCI layout store: %w", err) | ||
} | ||
|
||
mediaType := "application/vnd.kro.resourcegraphdefinition" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a valid media type. you store the rgd as yaml right? so the media type would be application/x-yaml
or similar that is recognized by IANA.
nameWithoutExt := basename[:len(basename)-len(ext)] | ||
outputTar := nameWithoutExt + ".tar" | ||
|
||
if err := packageRGD(outputTar, data, &rgd); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that you store the data here from the file. This can be a problem. Imagine if you have an unknown key inside your file. yaml.Unmarshal would work and then that key would be stored in the layer. Im not sure if thats intended. To maintain consistency with a stable media type, I would suggest that you marshal the rgd back into a byte stream and use that so you KNOW the format.
if you dont do this, then you need to at least understand what format the rgd file is in to suffix either +json
or +yaml
to the media type. Otherwise it will be hard to introspect later.
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@DhairyaMajmudar friendly reminder, are you still interested in working on this? |
Description
The new kro cli package command is useful to convert a RGD file into an OCI image which can be further published into registries like AWS or Docker hub.
Usage
kro package -f [FILE] -t [TAG]
Flags:
Demo
kro-package.webm