File tree Expand file tree Collapse file tree 3 files changed +17
-18
lines changed
Expand file tree Collapse file tree 3 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ require (
77 fortio.org/log v1.18.1
88 github.com/Masterminds/semver/v3 v3.4.0
99 github.com/andybalholm/brotli v1.2.0
10- github.com/avast/retry-go v3 .0.0+incompatible
10+ github.com/avast/retry-go/v5 v5 .0.0
1111 github.com/cenkalti/backoff/v4 v4.3.0
1212 github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443
1313 github.com/containers/image/v5 v5.36.2
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
7474github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 /go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs =
7575github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so =
7676github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 /go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw =
77- github.com/avast/retry-go v3 .0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0 =
78- github.com/avast/retry-go v3 .0.0+incompatible /go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY =
77+ github.com/avast/retry-go/v5 v5 .0.0 h1:kf1Qc2UsTZ4qq8elDymqfbISvkyMuhgRxuJqX2NHP7k =
78+ github.com/avast/retry-go/v5 v5 .0.0/go.mod h1://d+usmKWio1agtZfS1H/ltTqwtIfBnRq9zEwjc3eH8 =
7979github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM =
8080github.com/beorn7/perks v1.0.1 /go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw =
8181github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM =
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import (
2929 "sync"
3030 "time"
3131
32- "github.com/avast/retry-go"
32+ "github.com/avast/retry-go/v5 "
3333 "github.com/google/go-containerregistry/pkg/v1/remote/transport"
3434
3535 "github.com/envoyproxy/gateway/internal/logging"
@@ -158,24 +158,23 @@ func (p *permissionCache) Start(ctx context.Context) {
158158 const retryAttempts = 3
159159 const retryDelay = 1 * time .Second
160160 p .logger .Info ("rechecking permission for image" , "image" , e .image .String ())
161- err := retry .Do (
162- func () error {
163- err := p .checkAndUpdatePermission (ctx , e )
164- if err != nil && isRetriableError (err ) {
165- p .logger .Error (
166- err ,
167- "failed to check permission for image, will retry again" ,
168- "image" ,
169- e .image .String ())
170- return err
171- }
172- return nil
173- },
161+ err := retry .New (
174162 retry .Attempts (retryAttempts ),
175163 retry .DelayType (retry .BackOffDelay ),
176164 retry .Delay (retryDelay ),
177165 retry .Context (ctx ),
178- )
166+ ).Do (func () error {
167+ err := p .checkAndUpdatePermission (ctx , e )
168+ if err != nil && isRetriableError (err ) {
169+ p .logger .Error (
170+ err ,
171+ "failed to check permission for image, will retry again" ,
172+ "image" ,
173+ e .image .String ())
174+ return err
175+ }
176+ return nil
177+ })
179178 if err != nil {
180179 p .logger .Error (
181180 err ,
You can’t perform that action at this time.
0 commit comments