clouadpi: NewServer: move awsBucket parameter to a new ServerConfig struct

We will have more parameters soon so let's make this prettier sooner rather
than later.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-03-03 14:22:52 +01:00 committed by Ondřej Budai
parent 2765d2d9a8
commit 9feb7b59d6
4 changed files with 24 additions and 13 deletions

View file

@ -19,6 +19,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/auth"
"github.com/osbuild/osbuild-composer/internal/cloudapi"
v2 "github.com/osbuild/osbuild-composer/internal/cloudapi/v2"
"github.com/osbuild/osbuild-composer/internal/distroregistry"
"github.com/osbuild/osbuild-composer/internal/jobqueue"
"github.com/osbuild/osbuild-composer/internal/jobqueue/dbjobqueue"
@ -119,7 +120,10 @@ func (c *Composer) InitWeldr(repoPaths []string, weldrListener net.Listener,
}
func (c *Composer) InitAPI(cert, key string, enableTLS bool, enableMTLS bool, enableJWT bool, l net.Listener) error {
c.api = cloudapi.NewServer(c.workers, c.distros, c.config.Koji.AWS.Bucket)
config := v2.ServerConfig{
AWSBucket: c.config.Koji.AWS.Bucket,
}
c.api = cloudapi.NewServer(c.workers, c.distros, config)
c.koji = kojiapi.NewServer(c.logger, c.workers, c.rpm, c.distros)
if !enableTLS {