cloudapi/v2: Configurable aws bucket

Fixes #1855
This commit is contained in:
sanne 2021-10-05 21:36:08 +02:00 committed by Tom Gundersen
parent b6c08f3056
commit 4eca54b6ed
6 changed files with 16 additions and 12 deletions

View file

@ -104,7 +104,7 @@ 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.rpm, c.distros)
c.api = cloudapi.NewServer(c.workers, c.rpm, c.distros, c.config.Koji.AWS.Bucket)
c.koji = kojiapi.NewServer(c.logger, c.workers, c.rpm, c.distros)
if !enableTLS {

View file

@ -25,7 +25,7 @@ type KojiAPIConfig struct {
JWTKeysURL string `toml:"jwt_keys_url"`
JWTKeysCA string `toml:"jwt_ca_file"`
JWTACLFile string `toml:"jwt_acl_file"`
AWSConfig AWSConfig `toml:"aws_config"`
AWS AWSConfig `toml:"aws_config"`
}
type AWSConfig struct {
@ -80,6 +80,9 @@ func GetDefaultConfig() *ComposerConfigFile {
EnableTLS: true,
EnableMTLS: true,
EnableJWT: false,
AWS: AWSConfig{
Bucket: "image-builder.service",
},
},
Worker: WorkerAPIConfig{
EnableTLS: true,

View file

@ -33,6 +33,9 @@ func TestDefaultConfig(t *testing.T) {
EnableTLS: true,
EnableMTLS: true,
EnableJWT: false,
AWS: AWSConfig{
Bucket: "image-builder.service",
},
}, defaultConfig.Koji)
require.Equal(t, WorkerAPIConfig{