Skip to content

Commit

Permalink
Merge pull request #2529 from hekonsek/create_env_batch_name
Browse files Browse the repository at this point in the history
`jx create env` should not ask for name in batch mode
  • Loading branch information
jenkins-x-bot committed Dec 18, 2018
2 parents 5e55252 + 0a6dc99 commit 375eed7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kube/env.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kube

import (
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -47,6 +48,10 @@ func CreateEnvironmentSurvey(batchMode bool, authConfigSvc auth.ConfigService, d
}
data.Name = config.Name
} else {
if batchMode {
return nil, errors.New("Environment name cannot be empty. Use --name option.")
}

validator := func(val interface{}) error {
err := ValidateName(val)
if err != nil {
Expand Down

0 comments on commit 375eed7

Please sign in to comment.