From bd8f5ccbc14a5966451c20dfd9e7d221c7a568c5 Mon Sep 17 00:00:00 2001 From: Wito Date: Tue, 30 Apr 2024 20:51:09 +0200 Subject: [PATCH] fix(init): fix licenses with spaces and special characters (#5354) (#5355) --- cmd/kubectl-testkube/commands/init.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/kubectl-testkube/commands/init.go b/cmd/kubectl-testkube/commands/init.go index 32e2c927407..de335562023 100644 --- a/cmd/kubectl-testkube/commands/init.go +++ b/cmd/kubectl-testkube/commands/init.go @@ -121,11 +121,12 @@ func NewInitCmdDemo() *cobra.Command { if license == "" { response, err := pterm.DefaultInteractiveTextInput.Show("Enter license key") - license = response + license = strings.TrimSpace(response) ui.ExitOnError("cannot read license", err) } if len(license) != len(licenseFormat) { + sendErrTelemetry(cmd, cfg, "install_license_malformed", license, err) ui.Failf("license malformed, expected license of format: " + licenseFormat) }