Skip to content

[oci] Add function for configuring transport with retry backoff#563

Merged
stefanprodan merged 1 commit intofluxcd:mainfrom
somtochiama:oci-timeout
May 26, 2023
Merged

[oci] Add function for configuring transport with retry backoff#563
stefanprodan merged 1 commit intofluxcd:mainfrom
somtochiama:oci-timeout

Conversation

@somtochiama
Copy link
Copy Markdown
Member

This pull request is a follow-up to #533

It adds a function WithRetryTransport that accepts a remote.Backoff and returns a crane.Option that sets a transport which uses the backoff when retrying operations. This needed because the remote.WithRetryBackoff(backoff) is not used for retrying transport operations. For more context see: google/go-containerregistry#1692

Comment thread oci/client/retry_transport.go Outdated
Comment thread oci/client/retry_transport.go Outdated
Comment thread oci/client/retry_transport.go Outdated
@somtochiama somtochiama force-pushed the oci-timeout branch 2 times, most recently from 3d691e2 to 404b439 Compare May 25, 2023 09:09
@hiddeco hiddeco added the area/oci OCI related issues and pull requests label May 25, 2023
Comment thread oci/client/retry_transport.go Outdated
Copy link
Copy Markdown
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It LGTM!
Please squash the commits where applicable and add the relevant details in the body if needed.

This pr also splits LoginWithCredentials into a sub-function
GetAuthFromCredentials that returns the Authenticator. This
function can be used to get the authenticator for constructing
the retry transport.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
@stefanprodan stefanprodan merged commit 06656b6 into fluxcd:main May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/oci OCI related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants