fix so always returns

This commit is contained in:
Robert Lippens 2019-08-13 21:41:36 -07:00
parent 9bf84349d0
commit 22d2e9db30
No known key found for this signature in database
GPG key ID: 9984DABBD3F82E8F

View file

@ -83,9 +83,16 @@ func provideBuildStore(db *db.DB) core.BuildStore {
func provideLogStore(db *db.DB, config config.Config) core.LogStore {
if config.S3.Bucket == "" && config.AzureBlob.ContainerName == "" {
return logs.New(db)
}
s := logs.New(db)
if config.S3.Bucket != "" {
} else if config.AzureBlob.ContainerName != "" {
s := logs.New(db)
p := logs.NewAzureBlobEnv(
config.AzureBlob.ContainerName,
config.AzureBlob.StorageAccountName,
config.AzureBlob.StorageAccessKey,
)
return logs.NewCombined(p, s)
} else {
s := logs.New(db)
p := logs.NewS3Env(
config.S3.Bucket,
config.S3.Prefix,
@ -94,15 +101,6 @@ func provideLogStore(db *db.DB, config config.Config) core.LogStore {
)
return logs.NewCombined(p, s)
}
if config.AzureBlob.ContainerName != "" {
p := logs.NewAzureBlobEnv(
config.AzureBlob.ContainerName,
config.AzureBlob.StorageAccountName,
config.AzureBlob.StorageAccessKey,
)
return logs.NewCombined(p, s)
}
}
// provideStageStore is a Wire provider function that provides a