File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/credential-provider-imds/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,15 @@ export const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
18
18
*/
19
19
export const fromContainerMetadata = ( init : RemoteProviderInit = { } ) : CredentialProvider => {
20
20
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 ( ) ;
24
24
const credsResponse = JSON . parse ( await requestFromEcsImds ( timeout , requestOptions ) ) ;
25
25
if ( ! isImdsCredentials ( credsResponse ) ) {
26
26
throw new ProviderError ( "Invalid response received from instance metadata service." ) ;
27
27
}
28
28
return fromImdsCredentials ( credsResponse ) ;
29
29
} , maxRetries ) ;
30
- } ;
31
30
} ;
32
31
33
32
const requestFromEcsImds = async ( timeout : number , options : RequestOptions ) : Promise < string > => {
You can’t perform that action at this time.
0 commit comments