Skip to content

Commit e75fe71

Browse files
authored
chore(credential-provider-imds): providerConfigFromInit arrow function (#1315)
1 parent b9a1715 commit e75fe71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/credential-provider-imds/src/remoteProvider/RemoteProviderInit.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export const DEFAULT_TIMEOUT = 1000;
2+
3+
// The default in AWS SDK for Python and CLI (botocore) is no retry or one attempt
4+
// https://github.com/boto/botocore/blob/646c61a7065933e75bab545b785e6098bc94c081/botocore/utils.py#L273
25
export const DEFAULT_MAX_RETRIES = 0;
36

47
export interface RemoteProviderConfig {
@@ -15,10 +18,7 @@ export interface RemoteProviderConfig {
1518

1619
export type RemoteProviderInit = Partial<RemoteProviderConfig>;
1720

18-
export function providerConfigFromInit(
19-
init: RemoteProviderInit
20-
): RemoteProviderConfig {
21-
const { timeout = DEFAULT_TIMEOUT, maxRetries = DEFAULT_MAX_RETRIES } = init;
22-
23-
return { maxRetries, timeout };
24-
}
21+
export const providerConfigFromInit = ({
22+
maxRetries = DEFAULT_MAX_RETRIES,
23+
timeout = DEFAULT_TIMEOUT
24+
}: RemoteProviderInit): RemoteProviderConfig => ({ maxRetries, timeout });

0 commit comments

Comments
 (0)