Skip to content

Commit

Permalink
Merge pull request #661 from aledbf/update-client-go
Browse files Browse the repository at this point in the history
Avoid running nginx if the configuration file is empty
  • Loading branch information
aledbf authored Apr 27, 2017
2 parents 25d50fa + f4147e9 commit e911f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/nginx/pkg/cmd/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ func (n NGINXController) DefaultIngressClass() string {
// testTemplate checks if the NGINX configuration inside the byte array is valid
// running the command "nginx -t" using a temporal file.
func (n NGINXController) testTemplate(cfg []byte) error {
if len(cfg) == 0 {
return fmt.Errorf("invalid nginx configuration (empty)")
}
tmpfile, err := ioutil.TempFile("", "nginx-cfg")
if err != nil {
return err
Expand Down

0 comments on commit e911f20

Please sign in to comment.