Skip to content

Commit e24d49d

Browse files
constants
1 parent 38fcccf commit e24d49d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

venonactl/cmd/install.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ import (
3030
"github.com/spf13/viper"
3131
)
3232

33+
const (
34+
clusterNameMaxLength = 20
35+
namespaceMaxLength = 20
36+
)
37+
3338
var installCmdOptions struct {
3439
dryRun bool
3540
clusterNameInCodefresh string
@@ -219,10 +224,10 @@ func parseNodeSelector(s string) (nodeSelector, error) {
219224
}
220225

221226
func validateInstallOptions(opts plugins.InstallOptions) (error) {
222-
if len(opts.ClusterName) > 20 {
227+
if len(opts.ClusterName) > clusterNameMaxLength {
223228
return errors.New("cluster name lenght is limited to 20")
224229
}
225-
if len(opts.ClusterNamespace) > 20 {
230+
if len(opts.ClusterNamespace) > namespaceMaxLength {
226231
return errors.New("cluster namespace is limited to 20")
227232
}
228233
return nil

0 commit comments

Comments
 (0)