Skip to content

Commit

Permalink
chore: lock out of desparation
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmoellerdev committed Dec 19, 2024
1 parent 78283bb commit adab716
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/tech/oras/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ import (
"fmt"

"github.com/containerd/errdefs"
"github.com/moby/locker"
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
"oras.land/oras-go/v2/registry"
"oras.land/oras-go/v2/registry/remote/auth"

"ocm.software/ocm/api/oci/ociutils"
)

var _locker = locker.New()

type OrasPusher struct {
client *auth.Client
ref string
plainHTTP bool
}

func (c *OrasPusher) Push(ctx context.Context, d ociv1.Descriptor, src Source) (retErr error) {
_locker.Lock(c.ref)
defer _locker.Unlock(c.ref)

reader, err := src.Reader()
if err != nil {
return err
Expand Down

0 comments on commit adab716

Please sign in to comment.