Skip to content

Commit

Permalink
Merge pull request goharbor#15660 from reasonerjt/no-warning-groupclaim
Browse files Browse the repository at this point in the history
Do not print warning message if group claim is empty
  • Loading branch information
reasonerjt authored Sep 24, 2021
2 parents 5522ccb + fbcba77 commit c3f92a7
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 @@ -383,7 +383,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 c3f92a7

Please sign in to comment.