Skip to content

Commit 54f24fe

Browse files
issue 38
1 parent 034e4e3 commit 54f24fe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

venonactl/cmd/install.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ var installCmd = &cobra.Command{
164164
s.CodefreshAPI.BuildNodeSelector = bns
165165
builderInstallOpt.BuildNodeSelector = bns
166166

167+
err = validateInstallOptions(*builderInstallOpt)
168+
if err != nil {
169+
dieOnError(err)
170+
}
171+
167172
values := s.BuildValues()
168173
for _, p := range builder.Get() {
169174
values, err = p.Install(builderInstallOpt, values)
@@ -213,6 +218,16 @@ func parseNodeSelector(s string) (nodeSelector, error) {
213218
return nodeSelector{v[0]: v[1]}, nil
214219
}
215220

221+
func validateInstallOptions(opts plugins.InstallOptions) (error) {
222+
if len(opts.ClusterName) > 20 {
223+
return errors.New("cluster name lenght is limited to 20")
224+
}
225+
if len(opts.ClusterNamespace) > 20 {
226+
return errors.New("cluster namespace is limited to 20")
227+
}
228+
return nil
229+
}
230+
216231
// String returns a k8s compliant string representation of the nodeSelector. Only a single value is supported.
217232
func (ns nodeSelector) String() string {
218233
var s string

0 commit comments

Comments
 (0)