Skip to content

Commit

Permalink
Revert "Make 403 non-fatal for manifest existence checks (google#1691)"
Browse files Browse the repository at this point in the history
This reverts commit a927d7c.
  • Loading branch information
jonjohnsonjr committed May 16, 2023
1 parent a927d7c commit 5063c09
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/v1/remote/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,6 @@ func (rw *repoWriter) writeChild(ctx context.Context, child partial.Describable,
return nil
}

// TODO: Consider caching some representation of the tags/digests in the destination
// repository as a hint to avoid this optimistic check in cases where we will most
// likely have to do a PUT anyway, e.g. if we are overwriting a tag we just wrote.
func (rw *repoWriter) manifestExists(ctx context.Context, ref name.Reference, t Taggable) (bool, error) {
f := &fetcher{
target: ref.Context(),
Expand All @@ -412,14 +409,6 @@ func (rw *repoWriter) manifestExists(ctx context.Context, ref name.Reference, t
if terr.StatusCode == http.StatusNotFound {
return false, nil
}

// We treat a 403 here as non-fatal because this existence check is an optimization and
// some registries will return a 403 instead of a 404 in certain situations.
// E.g. https://jfrog.atlassian.net/browse/RTFACT-13797
if terr.StatusCode == http.StatusForbidden {
logs.Debug.Printf("manifestExists unexpected 403: %v", err)
return false, nil
}
}

return false, err
Expand Down

0 comments on commit 5063c09

Please sign in to comment.