From 545228a108c46cf30bfaed677e18f96a7dc52dd6 Mon Sep 17 00:00:00 2001 From: John Bresnahan Date: Tue, 2 Jan 2018 09:33:51 -1000 Subject: [PATCH] Check for deployment names with _ #30 --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 7df9a8e0..e19ca4fd 100644 --- a/main.go +++ b/main.go @@ -561,7 +561,11 @@ func (cliContext *CliContext) Logf(level int, format string, v ...interface{}) { func (cliContext *CliContext) nameValidate(a *kingpin.CmdClause) error { if len(cliContext.DeploymentName) > 20 { - return fmt.Errorf("Could the deployment name must be less than 20 characters") + return fmt.Errorf("The deployment name must be less than 20 characters") + } + // We may want to make this into a regex if otehr characters are problematic + if strings.Contains(cliContext.DeploymentName, "_") { + return fmt.Errorf("The deployment name must not contain a _") } return nil } @@ -577,7 +581,6 @@ func (cliContext *CliContext) envValidate(a *kingpin.CmdClause) error { return fmt.Errorf("The environment variable must have the form 'key=value'") } } - return nil }