Skip to content

Commit

Permalink
fix: Rename copy function to avoid built in collision (#1510)
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Howe <[email protected]>
  • Loading branch information
TerryHowe authored Sep 26, 2024
1 parent 8dc05a7 commit e0f4066
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit e0f4066

Please sign in to comment.