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]>

Empty commit

Signed-off-by: Maggie Chen <[email protected]>

fix lint

Signed-off-by: Maggie Chen <[email protected]>
  • Loading branch information
chenz4027 committed Apr 19, 2024
1 parent 73ec2f3 commit edde3d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/create/operatorroles/by_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ 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 edde3d4

Please sign in to comment.