Skip to content

Commit 2182404

Browse files
committed
chore(credential-provider-imds): remove redundant async/await
1 parent ec8ebbc commit 2182404

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/credential-provider-imds/src/fromContainerMetadata.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ export const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
1818
*/
1919
export const fromContainerMetadata = (init: RemoteProviderInit = {}): CredentialProvider => {
2020
const { timeout, maxRetries } = providerConfigFromInit(init);
21-
return async () => {
22-
const requestOptions = await getCmdsUri();
23-
return await retry(async () => {
21+
return () =>
22+
retry(async () => {
23+
const requestOptions = await getCmdsUri();
2424
const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
2525
if (!isImdsCredentials(credsResponse)) {
2626
throw new ProviderError("Invalid response received from instance metadata service.");
2727
}
2828
return fromImdsCredentials(credsResponse);
2929
}, maxRetries);
30-
};
3130
};
3231

3332
const requestFromEcsImds = async (timeout: number, options: RequestOptions): Promise<string> => {

0 commit comments

Comments
 (0)