From 5a0b317717c8f78570097a0d5f233a43b524357e Mon Sep 17 00:00:00 2001 From: Kian Parvin Date: Wed, 6 Sep 2023 11:08:06 +0200 Subject: [PATCH] Switch to User.Tag() --- internal/jimm/controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/jimm/controller.go b/internal/jimm/controller.go index ea0d16dcc..41527ea43 100644 --- a/internal/jimm/controller.go +++ b/internal/jimm/controller.go @@ -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 }