mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(uac): ignore duplicates, spaces and casing in portainer labels (#4823)
* fix: ignore duplicates, spaces and casing in portainer labels * cleanup * fix: rebase error
This commit is contained in:
parent
6c8276c65c
commit
f03cf2a6e4
4 changed files with 90 additions and 7 deletions
|
@ -1,10 +1,11 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"github.com/portainer/portainer/api"
|
||||
"strings"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/bolt/errors"
|
||||
"github.com/portainer/portainer/api/bolt/internal"
|
||||
"strings"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
)
|
||||
|
@ -61,7 +62,7 @@ func (service *Service) UserByUsername(username string) (*portainer.User, error)
|
|||
return err
|
||||
}
|
||||
|
||||
if strings.ToLower(u.Username) == username {
|
||||
if strings.EqualFold(u.Username, username) {
|
||||
user = &u
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue