Skip to content

Commit

Permalink
OCM-12379 | fix: Duplicate commands when manual create/accountroles
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterkepley authored and openshift-cherrypick-robot committed Nov 7, 2024
1 parent 0b3044a commit f7c2287
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 f7c2287

Please sign in to comment.