worker: Configure AWS credentials in the worker

This commit is contained in:
Thomas Lavocat 2021-09-23 16:40:41 +02:00 committed by Tom Gundersen
parent 7760ca1c92
commit 010a1f5022
4 changed files with 781 additions and 6 deletions

View file

@ -97,6 +97,9 @@ func main() {
Azure *struct {
Credentials string `toml:"credentials"`
} `toml:"azure"`
AWS *struct {
Credentials string `toml:"credentials"`
} `toml:"aws"`
Authentication *struct {
OAuthURL string `toml:"oauth_url"`
OfflineTokenPath string `toml:"offline_token"`
@ -232,6 +235,14 @@ func main() {
}
}
// If the credentials are not provided in the configuration, then the
// worker will look in $HOME/.aws/credentials or at the file pointed by
// the "AWS_SHARED_CREDENTIALS_FILE" variable.
var awsCredentials = ""
if config.AWS != nil {
awsCredentials = config.AWS.Credentials
}
jobImpls := map[string]JobImplementation{
"osbuild": &OSBuildJobImpl{
Store: store,
@ -239,6 +250,7 @@ func main() {
KojiServers: kojiServers,
GCPCreds: gcpCredentials,
AzureCreds: azureCredentials,
AWSCreds: awsCredentials,
},
"osbuild-koji": &OSBuildKojiJobImpl{
Store: store,