File tree Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change @@ -39,34 +39,11 @@ async function main() {
39
39
40
40
// Read the domain to fetch from stdin
41
41
let endpoint = fs . readFileSync ( 0 , { encoding : 'utf-8' } ) . trim ( ) ;
42
-
43
- const deadline = Date . now ( ) + 60_000 ; // 60 seconds timeout
44
- let lastError : Error | undefined ;
45
-
46
- while ( Date . now ( ) < deadline ) {
47
- try {
48
- const credentials = await fetchDockerLoginCredentials ( new DefaultAwsClient ( ) , config , endpoint ) ;
49
- // Write the credentials back to stdout
50
- fs . writeFileSync ( 1 , JSON . stringify ( credentials ) ) ;
51
- return ;
52
- } catch ( e : any ) {
53
- lastError = e ;
54
-
55
- // Retry on AccessDenied errors due to eventual consistency in AWS IAM.
56
- // Newly created roles and policies may take time to propagate across regions.
57
- if ( e . name === 'AccessDenied' ) {
58
- await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ; // Wait 5 seconds
59
- continue ;
60
- }
61
-
62
- // For other errors, throw immediately
63
- throw e ;
64
- }
42
+ const credentials = await fetchDockerLoginCredentials ( new DefaultAwsClient ( ) , config , endpoint ) ;
43
+ // Write the credentials back to stdout
44
+ fs . writeFileSync ( 1 , JSON . stringify ( credentials ) ) ;
65
45
}
66
46
67
- throw lastError ;
68
- }
69
-
70
47
main ( ) . catch ( ( e ) => {
71
48
// eslint-disable-next-line no-console
72
49
console . error ( e . stack ) ;
You can’t perform that action at this time.
0 commit comments