Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver/v3 v3.4.0
github.com/anchore/syft v1.45.0
github.com/buildpacks/pack v0.40.2
github.com/cenkalti/backoff/v4 v4.3.0
github.com/cenkalti/backoff/v7 v7.0.0
github.com/distribution/reference v0.6.0
github.com/docker/cli v29.6.1+incompatible
github.com/docker/docker v28.5.2+incompatible
Expand Down Expand Up @@ -110,6 +110,7 @@ require (
github.com/bodgit/windows v1.0.1 // indirect
github.com/buildpacks/imgutil v0.0.0-20251202182233-51c1c8c186ea // indirect
github.com/buildpacks/lifecycle v0.21.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/colorprofile v0.4.1 // indirect
github.com/charmbracelet/lipgloss v1.1.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cenkalti/backoff/v7 v7.0.0 h1:ZP+QAaaOnVUHo+ufFpZ835hbT3x2fy+h2lecVEosZ6A=
github.com/cenkalti/backoff/v7 v7.0.0/go.mod h1:qcKBGwsu4hpxHtQ8tWYsQ+ifzx2+sS+Xx/3jfe30lI8=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand Down
2 changes: 1 addition & 1 deletion internal/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

"github.com/Masterminds/semver/v3"
"github.com/buildpacks/pack/pkg/buildpack"
backoff "github.com/cenkalti/backoff/v4"
backoff "github.com/cenkalti/backoff/v7"
"github.com/distribution/reference"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
Expand All @@ -32,13 +32,13 @@
return Image{}, err
}
exponentialBackoff := backoff.NewExponentialBackOff()
exponentialBackoff.MaxElapsedTime = retryTimeLimit

Check failure on line 35 in internal/image.go

View workflow job for this annotation

GitHub Actions / Unit Tests

exponentialBackoff.MaxElapsedTime undefined (type *backoff.ExponentialBackOff has no field or method MaxElapsedTime)

Check failure on line 35 in internal/image.go

View workflow job for this annotation

GitHub Actions / lint

exponentialBackoff.MaxElapsedTime undefined (type *backoff.ExponentialBackOff has no field or method MaxElapsedTime)

// Use exponential backoff to retry failed requests when they fail with http.StatusTooManyRequests
err = backoff.RetryNotify(func() error {

Check failure on line 38 in internal/image.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: backoff.RetryNotify

Check failure on line 38 in internal/image.go

View workflow job for this annotation

GitHub Actions / lint

undefined: backoff.RetryNotify
resp, err = http.Get(fmt.Sprintf("%s/v1/buildpacks/%s", api, id))
if err != nil {
return &backoff.PermanentError{Err: err}

Check failure on line 41 in internal/image.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: backoff.PermanentError

Check failure on line 41 in internal/image.go

View workflow job for this annotation

GitHub Actions / lint

undefined: backoff.PermanentError
}

// only retry when the CNB registry status code is http.StatusTooManyRequests (429)
Expand All @@ -47,7 +47,7 @@
if resp.StatusCode == http.StatusTooManyRequests {
return err
}
return &backoff.PermanentError{Err: err}

Check failure on line 50 in internal/image.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: backoff.PermanentError

Check failure on line 50 in internal/image.go

View workflow job for this annotation

GitHub Actions / lint

undefined: backoff.PermanentError (typecheck)
}
return nil
},
Expand Down
Loading