@@ -1448,6 +1448,8 @@ func run(cmd *cobra.Command, _ []string) {
14481448 os .Exit (1 )
14491449 }
14501450
1451+ r .Reporter .Warnf ("Account roles not created by ROSA CLI cannot be listed, updated, or upgraded." )
1452+
14511453 if len (roleARNs ) > 1 {
14521454 defaultRoleARN := roleARNs [0 ]
14531455 // Prioritize roles with the default prefix
@@ -1497,13 +1499,18 @@ func run(cmd *cobra.Command, _ []string) {
14971499 if isHostedCP {
14981500 createAccountRolesCommand = createAccountRolesCommand + " " + hostedCPFlag
14991501 }
1500- r .Reporter .Warnf (fmt .Sprintf ("No compatible account roles with version '%s' found. " +
1501- "You will need to manually set them in the next steps or run '%s' to create them first." ,
1502- minor , createAccountRolesCommand ))
1502+ r .Reporter .Warnf ("No suitable account with ROSA CLI-created account roles were found. " +
1503+ "You can manually set them in the next steps or run '%s' to create them first." , createAccountRolesCommand )
15031504 interactive .Enable ()
15041505 }
15051506
15061507 if roleARN != "" {
1508+ // Check if role has red-hat-managed tag
1509+ hasTag := roles .CheckHasRedHatManagedTag (roleARN , awsClient )
1510+ if ! hasTag {
1511+ r .Reporter .Warnf ("The role '%s' is not a Red Hat managed role" , roleARN )
1512+ }
1513+
15071514 // check if role has hosted cp policy via AWS tag value
15081515 hostedCPPolicies , err := awsClient .HasHostedCPPolicies (roleARN )
15091516 if err != nil {
@@ -1559,13 +1566,18 @@ func run(cmd *cobra.Command, _ []string) {
15591566 if isHostedCP {
15601567 createAccountRolesCommand = createAccountRolesCommand + " " + hostedCPFlag
15611568 }
1562- r .Reporter .Warnf (fmt .Sprintf ("No compatible '%s' account roles with version '%s' found. " +
1563- "You will need to manually set them in the next steps or run '%s' to create them first." ,
1564- role .Name , minor , createAccountRolesCommand ))
1569+ r .Reporter .Warnf ("No suitable accounts with ROSA CLI-created account roles were found. " +
1570+ "You can manually set them in the next steps or run '%s' to create them first." , createAccountRolesCommand )
15651571 interactive .Enable ()
15661572 hasRoles = false
15671573 break
15681574 }
1575+
1576+ // Check if role has red-hat-managed tag
1577+ hasTag := roles .CheckHasRedHatManagedTag (selectedARN , awsClient )
1578+ if ! hasTag {
1579+ r .Reporter .Warnf ("The role '%s' is not a Red Hat managed role" , selectedARN )
1580+ }
15691581 if ! output .HasFlag () || r .Reporter .IsTerminal () {
15701582 r .Reporter .Infof ("Using %s for the %s role" , selectedARN , role .Name )
15711583 }
0 commit comments