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

fix: Rename copy function to avoid built in collision #1510

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/oras/root/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func runPush(cmd *cobra.Command, opts *pushOptions) error {
copyOptions.CopyGraphOptions.OnCopySkipped = displayStatus.OnCopySkipped
copyOptions.CopyGraphOptions.PreCopy = displayStatus.PreCopy
copyOptions.CopyGraphOptions.PostCopy = displayStatus.PostCopy
copy := func(root ocispec.Descriptor) error {
copyWithScopeHint := func(root ocispec.Descriptor) error {
// add both pull and push scope hints for dst repository
// to save potential push-scope token requests during copy
ctx = registryutil.WithScopeHint(ctx, dst, auth.ActionPull, auth.ActionPush)
Expand All @@ -230,7 +230,7 @@ func runPush(cmd *cobra.Command, opts *pushOptions) error {
}

// Push
root, err := doPush(dst, stopTrack, pack, copy)
root, err := doPush(dst, stopTrack, pack, copyWithScopeHint)
if err != nil {
return err
}
Expand Down Expand Up @@ -272,7 +272,7 @@ func doPush(dst oras.Target, stopTrack status.StopTrackTargetFunc, pack packFunc
type packFunc func() (ocispec.Descriptor, error)
type copyFunc func(desc ocispec.Descriptor) error

func pushArtifact(dst oras.Target, pack packFunc, copy copyFunc) (ocispec.Descriptor, error) {
func pushArtifact(_ oras.Target, pack packFunc, copy copyFunc) (ocispec.Descriptor, error) {
root, err := pack()
if err != nil {
return ocispec.Descriptor{}, err
Expand Down
Loading