Skip to content

Commit

Permalink
PR review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leoporoli committed Oct 24, 2023
1 parent adb0594 commit 9279fcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package docker_label_key
import (
"github.com/kurtosis-tech/stacktrace"
"regexp"
"strings"
)

const (
Expand Down Expand Up @@ -61,7 +62,8 @@ func (key *DockerLabelKey) GetString() string {
}

func validateNotEmptyUserCustomLabelKey(str string) error {
if str == "" || str == " " {
str = strings.TrimSpace(str)
if str == "" {
return stacktrace.NewError("User custom label key can't be an empty string")
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func (key *KubernetesLabelKey) GetString() string {
}

func validateNotEmptyUserCustomLabelKey(str string) error {
if str == "" || str == " " {
str = strings.TrimSpace(str)
if str == "" {
return stacktrace.NewError("User custom label key can't be an empty string")
}
return nil
Expand Down

0 comments on commit 9279fcf

Please sign in to comment.