Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
goruha and coderabbitai[bot] authored Jan 6, 2025
1 parent 1987461 commit 34916c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/atmos/aws-component-helper/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ func TestAcceptance(t *testing.T) {

testFolder, err := files.CopyFolderToTemp("../../../", t.Name(), func(path string) bool { return true })
require.NoError(t, err)
defer os.RemoveAll(testFolder)
defer func() {
if err := os.RemoveAll(testFolder); err != nil {
t.Errorf("failed to cleanup test folder: %v", err)
}
}()

fmt.Printf("running in %s\n", testFolder)

Expand Down
4 changes: 4 additions & 0 deletions pkg/atmos/aws-component-helper/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func getAwsAccountId() (string, error) {
if err != nil {
return "", err
}
// Add retries for better reliability
cfg.RetryMode = aws.RetryModeAdaptive

Check failure on line 122 in pkg/atmos/aws-component-helper/shared.go

View workflow job for this annotation

GitHub Actions / Run Tests

undefined: aws

Check failure on line 122 in pkg/atmos/aws-component-helper/shared.go

View workflow job for this annotation

GitHub Actions / Run Tests

undefined: aws
cfg.RetryMaxAttempts = 3

stsClient := sts.NewFromConfig(cfg)
identity, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{})
if err != nil {
Expand Down

0 comments on commit 34916c8

Please sign in to comment.