File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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.
217232func (ns nodeSelector ) String () string {
218233 var s string
You can’t perform that action at this time.
0 commit comments