-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
scorecard: add bundle metadata #3474
scorecard: add bundle metadata #3474
Conversation
"strings" | ||
|
||
"github.com/operator-framework/operator-registry/pkg/lib/bundle" | ||
yaml "gopkg.in/yaml.v3" |
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.
could we please use sigs.k8s.io/yaml
instead of this one for we still closer as possible to rip all these other modules to dealing with yaml as well?
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.
That isn't possible until we bump operator-registry versions since the struct being marshalled only has yaml
tags. I don't think we'll bump versions until after v1.0.
079c762
to
681eb76
Compare
681eb76
to
742d2a4
Compare
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 tested this out, seems to work as expected, I modified the annotations.yaml by adding operators.operatorframework.io.test.config.v1: tests/scorecard2/
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
I added a tests/scorecard2 directory with a valid config.yaml file....
I then removed the tests/scorecard directory...
and then ran scorecard, it produced a configMap that holds those values and the tests ran ok....I verified the bundle.tar.gz in the configmap as follows:
kubectl -n default get configmap scorecard-test-qdwt -o jsonpath='{.binaryData.bundle.tar.gz}' | base64 -d > /tmp/bundle.tar.gz
this confirmed that the annotations.yaml included in the configmap matched what I expected.
9002750
to
850009c
Compare
which are written to bundle metadata on `generate bundle` when either `--overwrite` is set or metadata files do not exist. "config.yaml" is a hard-coded file name for the scorecard config file. cmd/operator-sdk/generate/bundle: write scorecard bundle metadata to annotations.yaml and bundle.Dockerfile cmd/operator-sdk/scorecard: use scorecard metadata config path if it exists, defaulting to `tests/scorecard/config.yaml` internal/annotations: consolidate annotations for metrics and scorecard in subpackages here internal/scorecard: encode "config.yaml" as hard-coded file name for the scorecard config, and add metadata to example annotations.yaml files
850009c
to
d1ebfde
Compare
Description of the change:
tests/scorecard/config.yaml
Motivation for the change: This PR adds scorecard bundle metadata "mediaType" and "config", which are written to bundle metadata on
generate bundle
when either--overwrite
is set or metadata files do not exist. "config.yaml" is a hard-coded file name for the scorecard config file.Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs
/cc @jmccormick2001 @varshaprasad96 @joelanford
/kind feature