From 6020f4f675ed20bbd0cc0e2b16020a8974165c87 Mon Sep 17 00:00:00 2001 From: JP Pakalapati Date: Thu, 25 Jul 2024 03:09:43 +0530 Subject: [PATCH] Correctly parse usernames with underscore --- cmd/shell.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/shell.go b/cmd/shell.go index 59607a6..7380111 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -74,7 +74,8 @@ Examples: return nil } - podName := "shell-" + strings.Replace(user.Username, ".", "-", -1) + replacer := strings.NewReplacer(".", "-", "_", "-") + podName := "shell-" + replacer.Replace(user.Username) // Fetch options from flags image, err := cmd.Flags().GetString("image")