Skip to content

Commit

Permalink
Do not print warning message if group claim is empty
Browse files Browse the repository at this point in the history
fixes goharbor#15616

Signed-off-by: Daniel Jiang <[email protected]>
  • Loading branch information
reasonerjt committed Sep 24, 2021
1 parent 04cd65d commit fbcba77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pkg/oidc/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ func groupsFromClaims(gp claimsProvider, k string) ([]string, bool) {
}
g, ok := claimMap[k].([]interface{})
if !ok {
log.Warningf("Unable to get groups from claims, claims: %+v, groups claims key: %s", claimMap, k)
if len(strings.TrimSpace(k)) > 0 {
log.Warningf("Unable to get groups from claims, claims: %+v, groups claims key: %s", claimMap, k)
}
return res, false
}
for _, e := range g {
Expand Down

0 comments on commit fbcba77

Please sign in to comment.