Skip to content

Commit

Permalink
fix broken services
Browse files Browse the repository at this point in the history
  • Loading branch information
GiGurra committed Jul 14, 2023
1 parent 4278d0c commit de18c54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/flycd/deployment_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,12 @@ func readAppConfigs(path string) (model.AppConfig, map[string]any, error) {
return model.AppConfig{}, nil, err
}

// Remove http_service from untyped config if it is zero in the typed config
// Otherwise fly.io thinks we want to listen on port 0 :S
if typed.HttpService.IsEmpty() {
delete(untyped, "http_service")
}

return typed, untyped, nil
}

Expand Down
10 changes: 10 additions & 0 deletions internal/flycd/model/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ type HttpService struct {
Processes []string `yaml:"processes" toml:"processes,omitempty"`
}

func (s HttpService) IsEmpty() bool {
return s.InternalPort == 0 &&
s.ForceHttps == false &&
s.AutoStopMachines == false &&
s.AutoStartMachines == false &&
s.MinMachinesRunning == 0 &&
s.Concurrency == Concurrency{} &&
len(s.Processes) == 0
}

type Mount struct {
Source string `yaml:"source" toml:"source"`
Destination string `yaml:"destination" toml:"destination"`
Expand Down

0 comments on commit de18c54

Please sign in to comment.