From ac34f6a3520c56e9cccd255df35bcd0e6513b609 Mon Sep 17 00:00:00 2001 From: Craig O'Donnell Date: Thu, 18 Jan 2024 15:44:18 +0000 Subject: [PATCH] add namespace to locked password command --- pkg/handlers/login.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/handlers/login.go b/pkg/handlers/login.go index 3b43cd7a00..a8336966d7 100644 --- a/pkg/handlers/login.go +++ b/pkg/handlers/login.go @@ -82,7 +82,11 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) { JSON(w, http.StatusUnauthorized, loginResponse) return } else if err == user.ErrTooManyAttempts { - loginResponse.Error = "Admin Console has been locked. Please reset password using the \"kubectl kots reset-password\" command." + resetPasswordCmd := "kubectl kots reset-password" + if util.PodNamespace != "" { + resetPasswordCmd = fmt.Sprintf("%s -n %s", resetPasswordCmd, util.PodNamespace) + } + loginResponse.Error = fmt.Sprintf("Admin Console has been locked. Please reset password using the \"%s\" command.", resetPasswordCmd) JSON(w, http.StatusUnauthorized, loginResponse) return } else if err != nil {