From 900f5142418f4df5e68bfa85d1623052b0818623 Mon Sep 17 00:00:00 2001 From: hunterkepley Date: Thu, 7 Nov 2024 10:43:17 -0500 Subject: [PATCH] OCM-12379 | fix: Duplicate commands when manual create/accountroles --- cmd/create/accountroles/creators.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/create/accountroles/creators.go b/cmd/create/accountroles/creators.go index b307e6679..a11c0fc57 100644 --- a/cmd/create/accountroles/creators.go +++ b/cmd/create/accountroles/creators.go @@ -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) @@ -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) } }