-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: rename ManifestAddArtifactOptions.Annotations to ArtifactAnnotations #28981
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,7 +117,7 @@ func (ir *ImageEngine) ManifestAddArtifact(_ context.Context, name string, files | |
| options.WithType(opts.Type).WithConfigType(opts.ConfigType).WithLayerType(opts.LayerType) | ||
| options.WithConfig(opts.Config) | ||
| options.WithExcludeTitles(opts.ExcludeTitles).WithSubject(opts.Subject) | ||
| options.WithAnnotations(opts.Annotations) | ||
| options.WithAnnotations(opts.ArtifactAnnotations) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same reasoning — |
||
| options.WithFiles(files) | ||
| id, err := manifests.AddArtifact(ir.ClientCtx, name, options) | ||
| if 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.
Is this correct? It will set
ArtifactAnnotationinto the embedded fieldAnnotations.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.
Yes, correct. The
Annotations:field on this line belongs tolibimage.ManifestListAddArtifactOptions(theaddArtifactOptionsliteral at L358), not to the embeddedentities.ManifestAnnotateOptions. So it sets the artifact's annotations — the same destination they had before this PR.The value is unchanged: before the rename,
ManifestAddArtifactOptionshad a directAnnotationsfield that shadowed the embeddedManifestAnnotateOptions.Annotations(bothmap[string]string), soopts.Annotationshere already resolved to the artifact field (jsonartifact_annotations). The rename keeps that json/schema tag, soopts.ArtifactAnnotationsis the identical field — only the Go symbol is now unambiguous.The manifest-list (index) annotations travel a separate path and are untouched: they're read via the fully-qualified
opts.ManifestAnnotateOptions.Annotationsat L382 intoManifestListAnnotateOptions. That qualified access already existed precisely because the direct field used to shadow the embedded one, so the rename can't orphan or misroute it.Net: artifact annotations → artifact options (this line); manifest annotations → annotate options (L382). The rename only removes the duplicate
x-go-name: Annotationsin the generated swagger model — no behavior change.