Skip to content

Commit f4f2152

Browse files
authored
Sanitize UserInfo.UID before using as label value (#368)
Fixes #367
1 parent de6dd2e commit f4f2152

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/webhook/appwrapper_webhook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ func (w *appWrapperWebhook) Default(ctx context.Context, obj runtime.Object) err
9292
}
9393
userInfo := request.UserInfo
9494
username := utils.SanitizeLabel(userInfo.Username)
95-
aw.Labels = utilmaps.MergeKeepFirst(map[string]string{AppWrapperUsernameLabel: username, AppWrapperUserIDLabel: userInfo.UID}, aw.Labels)
95+
userUID := utils.SanitizeLabel(userInfo.UID)
96+
aw.Labels = utilmaps.MergeKeepFirst(map[string]string{AppWrapperUsernameLabel: username, AppWrapperUserIDLabel: userUID}, aw.Labels)
9697

9798
return nil
9899
}

0 commit comments

Comments
 (0)