Skip to content

Commit

Permalink
OCM-7415 | feat: Ensure account roles have expected attached policies
Browse files Browse the repository at this point in the history
Signed-off-by: marcolan018 <llan@redhat.com>
  • Loading branch information
marcolan018 committed May 9, 2024
1 parent da3615e commit b6923f9
Show file tree
Hide file tree
Showing 9 changed files with 420 additions and 196 deletions.
3 changes: 0 additions & 3 deletions cmd/upgrade/accountroles/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ func buildCommands(prefix string, partition string, accountID string, isUpgradeN
_, err := awsClient.IsPolicyExists(policyARN)
hasPolicy := err == nil
policyName := aws.GetPolicyName(accRoleName)
_, err = awsClient.IsRolePolicyExists(accRoleName, policyName)
hasInlinePolicy := err == nil
upgradeAccountPolicyCommands := awscbRoles.ManualCommandsForUpgradeAccountRolePolicy(
awscbRoles.ManualCommandsForUpgradeAccountRolePolicyInput{
DefaultPolicyVersion: defaultPolicyVersion,
Expand All @@ -349,7 +347,6 @@ func buildCommands(prefix string, partition string, accountID string, isUpgradeN
PolicyName: policyName,
AccountPolicyPath: policyPath,
PolicyARN: policyARN,
HasInlinePolicy: hasInlinePolicy,
},
)
commands = append(commands, upgradeAccountPolicyCommands...)
Expand Down

0 comments on commit b6923f9

Please sign in to comment.