Skip to content

Commit

Permalink
Validate proxy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
agarciamontoro committed Sep 12, 2024
1 parent 44ac9fc commit 9b66f83
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,24 @@ func (c *Config) IsValid() error {
return err
}

if err := c.validateProxyConfig(); err != nil {
return err
}

if err := c.validateDBName(); err != nil {
return err
}

return nil
}

func (c *Config) validateProxyConfig() error {
if c.AppInstanceCount > 1 && c.ProxyInstanceCount < 1 && c.ServerURL == "" {
return fmt.Errorf("the deployment will create more than one app node, but no proxy is being deployed and no external proxy has been configured: either set ProxyInstanceCount to 1, or set ServerURL to the URL of an external proxy")
}
return nil
}

// DBName returns the database name for the deployment.
func (c *Config) DBName() string {
if c.TerraformDBSettings.DBName != "" {
Expand Down

0 comments on commit 9b66f83

Please sign in to comment.