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.
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.
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
jmccormick2001
left a comment
There was a problem hiding this comment.
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.yamlMotivation for the change: This PR adds scorecard bundle metadata "mediaType" and "config", which are written to bundle metadata on
generate bundlewhen either--overwriteis 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