Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3112 from slurms/validate_env_vars_before_release
Browse files Browse the repository at this point in the history
cli: prevent empty environment variable keys
  • Loading branch information
lmars committed Jul 13, 2016
2 parents d2ac28d + d3c60a4 commit 228cb2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controller/release.go
Expand Up @@ -63,6 +63,13 @@ func (r *ReleaseRepo) Add(data interface{}) error {
release.ArtifactIDs = []string{release.LegacyArtifactID}
}

if value, ok := release.Env[""]; ok {
return ct.ValidationError{
Field: "env",
Message: fmt.Sprintf("you can't create an env var with an empty key (tried to set \"\"=%q)", value),
}
}

tx, err := r.db.Begin()
if err != nil {
return err
Expand Down

0 comments on commit 228cb2e

Please sign in to comment.