Skip to content

Commit

Permalink
Fall back to puller if reusing pusher fails (#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjohnsonjr committed Apr 25, 2023
1 parent 005bb71 commit b7c6e9d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/v1/remote/puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"sync"

"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/partial"
Expand Down Expand Up @@ -78,10 +79,10 @@ func (p *Puller) fetcher(ctx context.Context, target resource) (*fetcher, error)
if p.o.pusher != nil {
if repo, ok := target.(name.Repository); ok {
w, err := p.o.pusher.writer(ctx, repo, p.o)
if err != nil {
return nil, err
if err == nil {
return fetcherFromWriter(w.w), nil
}
return fetcherFromWriter(w.w), nil
logs.Debug.Printf("reusing Pusher failed: %v", err)
}
}

Expand Down

0 comments on commit b7c6e9d

Please sign in to comment.