chore(cli): print groups when retrieving roles info (#24522)

Signed-off-by: nitishfy <justnitish06@gmail.com>
This commit is contained in:
Nitish Kumar
2025-09-11 20:20:39 +05:30
committed by GitHub
parent 7ae14c89d9
commit 2e5601f932
3 changed files with 81 additions and 2 deletions

View File

@@ -605,8 +605,17 @@ ID ISSUED-AT EXPIRES-AT
fmt.Printf(printRoleFmtStr, "Description:", role.Description)
fmt.Printf("Policies:\n")
fmt.Printf("%s\n", proj.ProjectPoliciesString())
fmt.Printf("Groups:\n")
// if the group exists in the role
// range over each group and print it
if v1alpha1.RoleGroupExists(role) {
for _, group := range role.Groups {
fmt.Printf(" - %s\n", group)
}
} else {
fmt.Println("<none>")
}
fmt.Printf("JWT Tokens:\n")
// TODO(jessesuen): print groups
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
fmt.Fprintf(w, "ID\tISSUED-AT\tEXPIRES-AT\n")
for _, token := range proj.Status.JWTTokensByRole[roleName].Items {