Skip to content

Commit

Permalink
remove reference to log, use fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
NiniOak committed Oct 9, 2024
1 parent f693a01 commit c844e2e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hack/aws-acceptance-test-cleanup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"errors"
"flag"
"fmt"
"log"
"os"
"os/signal"
"strings"
Expand Down Expand Up @@ -782,7 +781,7 @@ func cleanupIAMRoles(ctx context.Context, iamClient *iam.IAM) error {
if aws.StringValue(role.RoleName)[:len(prefix)] == prefix {
err := detachRolePolicies(iamClient, role.RoleName)
if err != nil {
log.Printf("Failed to detach policies for role %s: %v", *role.RoleName, err)
fmt.Printf("Failed to detach policies for role %s: %v", *role.RoleName, err)
continue
}

Expand All @@ -791,9 +790,9 @@ func cleanupIAMRoles(ctx context.Context, iamClient *iam.IAM) error {
RoleName: role.RoleName,
})
if err != nil {
log.Printf("Failed to delete role %s: %v", *role.RoleName, err)
fmt.Printf("Failed to delete role %s: %v", *role.RoleName, err)
} else {
log.Printf("Deleted role: %s", *role.RoleName)
fmt.Printf("Deleted role: %s", *role.RoleName)
}
}
}
Expand All @@ -812,7 +811,7 @@ func detachRolePolicies(iamClient *iam.IAM, roleName *string) error {
PolicyArn: policy.PolicyArn,
})
if err != nil {
log.Printf("Failed to detach policy %s from role %s: %v", *policy.PolicyArn, *roleName, err)
fmt.Printf("Failed to detach policy %s from role %s: %v", *policy.PolicyArn, *roleName, err)
}
}
return !lastPage
Expand Down

0 comments on commit c844e2e

Please sign in to comment.