Skip to content

Commit

Permalink
OCM-5247 | fix: block HCP operator-roles with unmanaged policies acco…
Browse files Browse the repository at this point in the history
…unt role

Signed-off-by: Maggie Chen <[email protected]>
  • Loading branch information
chenz4027 committed Apr 18, 2024
1 parent 73ec2f3 commit 17a72c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/create/operatorroles/by_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func handleOperatorRoleCreationByPrefix(r *rosa.Runtime, env string,
r.Reporter.Errorf("Failed to determine if the Installer role ARN has hosted CP policies: %v", err)
os.Exit(1)
}

if !hostedCPPolicies {
r.Reporter.Errorf("Failed to create the operator role since the Installer role ARN '%v' does not have hosted CP policies", args.installerRoleArn)
os.Exit(1)
}
}

operatorRolesList, err := convertV1OperatorIAMRoleIntoOcmOperatorIamRole(operatorIAMRoleList)
Expand Down

0 comments on commit 17a72c3

Please sign in to comment.