From e3584e9d8bd062d6628d26f88621868d4c686fad Mon Sep 17 00:00:00 2001 From: Tulsi Shah Date: Wed, 9 Oct 2024 07:34:10 +0000 Subject: [PATCH 1/2] make createFolder and deleteFolder retryable --- internal/storage/storageutil/control_client.go | 2 ++ internal/storage/storageutil/user_agent_round_tripper.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/storage/storageutil/control_client.go b/internal/storage/storageutil/control_client.go index 451d15c1a7..b4eceb4d62 100644 --- a/internal/storage/storageutil/control_client.go +++ b/internal/storage/storageutil/control_client.go @@ -49,6 +49,8 @@ func setRetryConfigForFolderAPIs(sc *control.StorageControlClient, clientConfig sc.CallOptions.RenameFolder = storageControlClientRetryOptions(clientConfig) sc.CallOptions.GetFolder = storageControlClientRetryOptions(clientConfig) sc.CallOptions.GetStorageLayout = storageControlClientRetryOptions(clientConfig) + sc.CallOptions.CreateFolder = storageControlClientRetryOptions(clientConfig) + sc.CallOptions.DeleteFolder = storageControlClientRetryOptions(clientConfig) } func CreateGRPCControlClient(ctx context.Context, clientOpts []option.ClientOption, clientConfig *StorageClientConfig) (controlClient *control.StorageControlClient, err error) { diff --git a/internal/storage/storageutil/user_agent_round_tripper.go b/internal/storage/storageutil/user_agent_round_tripper.go index 5dd29d5aa7..1b5fad72f3 100644 --- a/internal/storage/storageutil/user_agent_round_tripper.go +++ b/internal/storage/storageutil/user_agent_round_tripper.go @@ -26,5 +26,6 @@ type userAgentRoundTripper struct { func (ug *userAgentRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { r.Header.Set("User-Agent", ug.UserAgent) + r.Header.Set("x-retry-test-id","31458370e65a45769b2c4a75c5a0975d") return ug.wrapped.RoundTrip(r) } From 648c5d22301edb5b048e62a7a6d4c7789b494bcb Mon Sep 17 00:00:00 2001 From: Tulsi Shah Date: Wed, 9 Oct 2024 07:40:37 +0000 Subject: [PATCH 2/2] lint fix --- internal/storage/storageutil/user_agent_round_tripper.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/storage/storageutil/user_agent_round_tripper.go b/internal/storage/storageutil/user_agent_round_tripper.go index 1b5fad72f3..5dd29d5aa7 100644 --- a/internal/storage/storageutil/user_agent_round_tripper.go +++ b/internal/storage/storageutil/user_agent_round_tripper.go @@ -26,6 +26,5 @@ type userAgentRoundTripper struct { func (ug *userAgentRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { r.Header.Set("User-Agent", ug.UserAgent) - r.Header.Set("x-retry-test-id","31458370e65a45769b2c4a75c5a0975d") return ug.wrapped.RoundTrip(r) }