Skip to content

Commit

Permalink
fix(init): fix licenses with spaces and special characters (#5354) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat authored Apr 30, 2024
1 parent 3a77709 commit bd8f5cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/kubectl-testkube/commands/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bd8f5cc

Please sign in to comment.