Skip to content
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

manifests: preserve Annotations when adding from indexes #1917

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

nalind
Copy link
Member

@nalind nalind commented Mar 18, 2024

When adding items from one index into another, preserve the annotations and URLs which are set in the descriptors in the source index.

@nalind nalind force-pushed the index-add-annotations branch 3 times, most recently from c32923c to f4fe6b7 Compare March 18, 2024 17:46
@@ -547,6 +556,8 @@ func (l *list) Add(ctx context.Context, sys *types.SystemContext, ref types.Imag
OSFeatures: append([]string{}, platform.OSFeatures...),
Size: instance.Size,
ArtifactType: instance.ArtifactType,
Annotations: mapToSlice(instance.Annotations),
URLs: slices.Clone(instance.URLs),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason for the clone? I cannot see anything modifying the slice so I don't think clone is needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it.

When adding items from one index into another, preserve the annotations
and URLs which are set in the descriptors in the source index.

Signed-off-by: Nalin Dahyabhai <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Mar 25, 2024

LGTM
@Luap99 PTAL

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Contributor

openshift-ci bot commented Apr 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, nalind

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Apr 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit db1c3c4 into containers:main Apr 2, 2024
7 checks passed
@nalind nalind deleted the index-add-annotations branch April 2, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants