-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cmd/operator-sdk/scorecard: change source of truth for bundle metadata #3450
cmd/operator-sdk/scorecard: change source of truth for bundle metadata #3450
Conversation
3931825
to
671ebcf
Compare
671ebcf
to
d798aa0
Compare
labels, err := reg.Labels(ctx, registryimage.SimpleReference(image)) | ||
if err != nil { | ||
return nil, fmt.Errorf("error reading image %s labels: %v", image, err) | ||
func findBundleMetadata(fs afero.Fs, bundleRoot string) (Labels, string, error) { |
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 function in particular needs the most scrutiny.
d798aa0
to
39aa250
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.
lgtm the only nit is the error message in the case of a user type-o in the annotations.yaml to cause it to not unmarshal, but that could be improved in a follow-up PR.
39aa250
to
fb9dda6
Compare
@jmccormick2001 now the error from |
fb9dda6
to
25b01a5
Compare
…ch use image labels as the source of truth for bundle metadata if a bundle image is supplied to `scorecard`. The SDK should consider the metadata directory to contain sources of truth for bundle metadata; image labels are informative only. cmd/operator-sdk/scorecard: always use on-disk metadata images/scorecard-test/cmd/test: look up metadata using FindBundleMetadata internal/registry: rewrite metadata lookup functions as FindBundleMetadata, which recursively searches for a file matching the annotations.yaml spec then returns that metadata and its path internal/scorecard: remove 'labels' directory functionality, which is no longer needed now that metadata is always looked up recursively
25b01a5
to
5d443a1
Compare
Description of the change:
FindBundleMetadata
FindBundleMetadata
, which recursively searches for a file matching theannotations.yaml
spec then returns that metadata and its pathMotivation for the change: This commit reverts some changes made in #3062, which use image labels as the source of truth for bundle metadata if a bundle image is supplied to
scorecard
. The SDK should consider the metadata directory to contain sources of truth for bundle metadata; image labels are informative only.Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs