Skip to content

oci/client: Configureable retry backoff#533

Merged
stefanprodan merged 1 commit intofluxcd:mainfrom
somtochiama:oci-push
May 11, 2023
Merged

oci/client: Configureable retry backoff#533
stefanprodan merged 1 commit intofluxcd:mainfrom
somtochiama:oci-push

Conversation

@somtochiama
Copy link
Copy Markdown
Member

@somtochiama somtochiama commented Apr 12, 2023

Part of: fluxcd/flux2#3714

This pull request adds a function to configure the retry backoff on crane option for different OCI operations.

It also removes the NewLocalClient function, adding a function DefaultOptions that returns an array of crane.Options that can be passed into NewClient to get the same result.

@stefanprodan stefanprodan added enhancement New feature or request area/oci OCI related issues and pull requests labels Apr 13, 2023
Comment thread oci/client/push.go Outdated
Comment thread oci/client/client.go Outdated
func NewLocalClient() *Client {
options := []crane.Option{
crane.WithUserAgent(oci.UserAgent),
func LocalOptions() []crane.Option {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func LocalOptions() []crane.Option {
func DefaultOptions() []crane.Option {

Comment thread oci/client/client.go Outdated
return []crane.Option{
crane.WithPlatform(&gcrv1.Platform{
Architecture: "flux",
Architecture: "flusx",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a typo?

Comment thread oci/client/client.go
Comment thread oci/client/client.go
Comment thread oci/client/client.go
Comment thread oci/client/push.go Outdated
@darkowlzz darkowlzz changed the title Configure timeout for oci push operations oci/client: Configureable retry backoff May 11, 2023
@darkowlzz
Copy link
Copy Markdown
Contributor

darkowlzz commented May 11, 2023

I've renamed the PR as the change is a general client change and not specific to the push operation. Edit it further if needed for more clarity.
Also, please update the description of the PR accordingly to reflect the change.

@somtochiama somtochiama marked this pull request as ready for review May 11, 2023 10:43
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
@somtochiama
Copy link
Copy Markdown
Member Author

@darkowlzz I have updated the PR and added comments for the public functions now.

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.

LGTM!

Copy link
Copy Markdown
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @somtochiama

@stefanprodan stefanprodan merged commit 6c409ba into fluxcd:main May 11, 2023
@stefanprodan
Copy link
Copy Markdown
Member

This has been tagged as oci/v0.24.0 please go ahead with the CLI changes.

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 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants