worker: Merge configs

This commit is contained in:
sanne 2021-07-16 00:56:50 +02:00 committed by Sanne Raymaekers
parent c865f75232
commit 7555ed7556
2 changed files with 3 additions and 5 deletions

View file

@ -65,7 +65,7 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string, logger *
return nil, fmt.Errorf("cannot create jobqueue: %v", err)
}
c.workers = worker.NewServer(c.logger, jobs, artifactsDir, c.config.WorkerAPI.IdentityFilter)
c.workers = worker.NewServer(c.logger, jobs, artifactsDir, c.config.Worker.IdentityFilter)
return &c, nil
}
@ -108,7 +108,7 @@ func (c *Composer) InitLocalWorker(l net.Listener) {
}
func (c *Composer) InitRemoteWorkers(cert, key string, l net.Listener) error {
if len(c.config.WorkerAPI.IdentityFilter) > 0 {
if len(c.config.Worker.IdentityFilter) > 0 {
c.workerListener = l
} else {
tlsConfig, err := createTLSConfig(&connectionConfig{

View file

@ -14,13 +14,11 @@ type ComposerConfigFile struct {
Worker struct {
AllowedDomains []string `toml:"allowed_domains"`
CA string `toml:"ca"`
IdentityFilter []string `toml:"identity_filter"`
} `toml:"worker"`
ComposerAPI struct {
IdentityFilter []string `toml:"identity_filter"`
} `toml:"composer_api"`
WorkerAPI struct {
IdentityFilter []string `toml:"identity_filter"`
} `toml:"worker_api"`
}
func LoadConfig(name string) (*ComposerConfigFile, error) {