Skip to content

Commit

Permalink
Merge pull request #2602 from hunterkepley/ocm-12379
Browse files Browse the repository at this point in the history
OCM-12379 | fix: Duplicate commands when manual create/accountroles
  • Loading branch information
openshift-merge-bot[bot] authored Nov 7, 2024
2 parents 0cd254b + 900f514 commit dd3d9d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/create/accountroles/creators.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ func (hcp *hcpManagedPoliciesCreator) printCommands(r *rosa.Runtime, input *acco

createRole := buildCreateRoleCommand(accRoleName, file, iamTags, input)

commands = append(commands, createRole)

policyKeys := aws.GetHcpAccountRolePolicyKeys(file)
for _, policyKey := range policyKeys {
policyARN, err := aws.GetManagedPolicyARN(input.policies, policyKey)
Expand All @@ -368,7 +370,7 @@ func (hcp *hcpManagedPoliciesCreator) printCommands(r *rosa.Runtime, input *acco
}

attachRolePolicy := buildAttachRolePolicyCommand(accRoleName, policyARN)
commands = append(commands, createRole, attachRolePolicy)
commands = append(commands, attachRolePolicy)
}
}

Expand Down

0 comments on commit dd3d9d5

Please sign in to comment.