Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
oksana-grishchenko committed Feb 15, 2024
1 parent 14e8ff6 commit c30e2c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ const (
disableTelemetryEnvVar = "DISABLE_TELEMETRY"
)

//nolint:gochecknoglobals
var (
ErrNSEmpty = errors.New("namespace list is empty. Specify at least one namespace")
// ErrNSEmpty appears when the provided list of the namespaces is considered empty.
ErrNSEmpty = errors.New("namespace list is empty. Specify at least one namespace")
// ErrNSReserved appears when some of the provided names are forbidden to use.
ErrNSReserved = func(ns string) error {
return fmt.Errorf("'%s' namespace is reserved for Everest internals. Please specify another namespace", ns)
}
// ErrNameNotRFC1035Compatible appears when some of the provided names are not RFC1035 compatible.
ErrNameNotRFC1035Compatible = func(fieldName string) error {
return fmt.Errorf(`'%s' is not RFC 1035 compatible. The name should contain only lowercase alphanumeric characters or '-', start with an alphabetic character, end with an alphanumeric character`,
fieldName,
Expand Down Expand Up @@ -590,7 +594,7 @@ func (o *Install) generateToken(ctx context.Context) (*token.ResetResponse, erro
return res, nil
}

// ValidateNamespaces validates a comma-separated namespaces string
// ValidateNamespaces validates a comma-separated namespaces string.
func ValidateNamespaces(str string) ([]string, error) {
nsList := strings.Split(str, ",")
m := make(map[string]struct{})
Expand Down
1 change: 1 addition & 0 deletions pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestValidateNamespaces(t *testing.T) {
}

for _, tc := range tcases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
output, err := ValidateNamespaces(tc.input)
Expand Down

0 comments on commit c30e2c5

Please sign in to comment.