Skip to content

Commit

Permalink
Switch to User.Tag()
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Sep 6, 2023
1 parent 494eef5 commit 5a0b317
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/jimm/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ func (j *JIMM) ImportModel(ctx context.Context, u *dbmodel.User, controllerName

var usersExcludingLocalUsers []dbmodel.UserModelAccess
for _, userAccess := range model.Users {
username, err := names.ParseUserTag("user" + "-" + userAccess.User.Username)
if err != nil {
zapctx.Error(ctx, "failed to parse user tag", zap.String("username", userAccess.User.Username))
userTag, ok := userAccess.User.Tag().(names.UserTag)
if !ok {
zapctx.Error(ctx, "failed to extract user tag", zap.String("username", userAccess.User.Username))
continue
}
if username.IsLocal() {
if userTag.IsLocal() {
// Don't propogate local users into JIMM.
continue
}
Expand Down

0 comments on commit 5a0b317

Please sign in to comment.