@@ -1448,6 +1448,8 @@ func run(cmd *cobra.Command, _ []string) {
1448
1448
os .Exit (1 )
1449
1449
}
1450
1450
1451
+ r .Reporter .Warnf ("Account roles not created by ROSA CLI cannot be listed, updated, or upgraded." )
1452
+
1451
1453
if len (roleARNs ) > 1 {
1452
1454
defaultRoleARN := roleARNs [0 ]
1453
1455
// Prioritize roles with the default prefix
@@ -1497,13 +1499,18 @@ func run(cmd *cobra.Command, _ []string) {
1497
1499
if isHostedCP {
1498
1500
createAccountRolesCommand = createAccountRolesCommand + " " + hostedCPFlag
1499
1501
}
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 )
1503
1504
interactive .Enable ()
1504
1505
}
1505
1506
1506
1507
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
+
1507
1514
// check if role has hosted cp policy via AWS tag value
1508
1515
hostedCPPolicies , err := awsClient .HasHostedCPPolicies (roleARN )
1509
1516
if err != nil {
@@ -1559,13 +1566,18 @@ func run(cmd *cobra.Command, _ []string) {
1559
1566
if isHostedCP {
1560
1567
createAccountRolesCommand = createAccountRolesCommand + " " + hostedCPFlag
1561
1568
}
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 )
1565
1571
interactive .Enable ()
1566
1572
hasRoles = false
1567
1573
break
1568
1574
}
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
+ }
1569
1581
if ! output .HasFlag () || r .Reporter .IsTerminal () {
1570
1582
r .Reporter .Infof ("Using %s for the %s role" , selectedARN , role .Name )
1571
1583
}
0 commit comments