Skip to content

Commit

Permalink
OCM-13047 | fix: Oproles add path to hcpsharedvpc policy ARNs manual …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
hunterkepley authored and openshift-cherrypick-robot committed Dec 11, 2024
1 parent 0bbbd7b commit 1fe59e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/create/operatorroles/by_clusterkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ func buildCommands(r *rosa.Runtime, env string,

// Attach policies to roles
for _, policy := range policies {
arn := fmt.Sprintf("arn:%s:iam::%s:policy/%s", r.Creator.Partition, r.Creator.AccountID, policy)
arn := aws.GetPolicyArn(r.Creator.Partition, r.Creator.AccountID, policy, path)

attachSharedVpcRolePolicy = awscb.NewIAMCommandBuilder().
SetCommand(awscb.AttachRolePolicy).
AddParam(awscb.RoleName, roleName).
Expand Down
3 changes: 2 additions & 1 deletion cmd/create/operatorroles/by_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ func buildCommandsFromPrefix(r *rosa.Runtime, env string,

// Attach policies to roles
for _, policy := range policies {
arn := fmt.Sprintf("arn:%s:iam::%s:policy/%s", r.Creator.Partition, r.Creator.AccountID, policy)
arn := aws.GetPolicyArn(r.Creator.Partition, r.Creator.AccountID, policy, path)

attachSharedVpcRolePolicy = awscb.NewIAMCommandBuilder().
SetCommand(awscb.AttachRolePolicy).
AddParam(awscb.RoleName, roleName).
Expand Down

0 comments on commit 1fe59e9

Please sign in to comment.