composer: add sanity checks
Running composer without workers or APIs enabled is pretty much a no-op. Let's forbid that. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
71428d3131
commit
117da5aa8a
1 changed files with 9 additions and 0 deletions
|
|
@ -156,6 +156,15 @@ func (c *Composer) InitRemoteWorkers(cert, key string, l net.Listener) error {
|
||||||
//
|
//
|
||||||
// Running without the weldr API is currently not supported.
|
// Running without the weldr API is currently not supported.
|
||||||
func (c *Composer) Start() error {
|
func (c *Composer) Start() error {
|
||||||
|
// sanity checks
|
||||||
|
if c.localWorkerListener == nil && c.workerListener == nil {
|
||||||
|
log.Fatal("neither the local worker socket nor the remote worker socket is enabled, osbuild-composer is useless without workers")
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.apiListener == nil && c.weldrListener == nil {
|
||||||
|
log.Fatal("neither the weldr API socket nor the composer API socket is enabled, osbuild-composer is useless without one of these APIs enabled")
|
||||||
|
}
|
||||||
|
|
||||||
if c.localWorkerListener != nil {
|
if c.localWorkerListener != nil {
|
||||||
go func() {
|
go func() {
|
||||||
err := c.workers.Serve(c.localWorkerListener)
|
err := c.workers.Serve(c.localWorkerListener)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue