worker/osbuild: use dedicated struct for GCP config internally

Previously, the internal `OSBuildJobImpl` structure defined only
`GCPCreds` member. This is not practical, once there will be more
than one GCP-related variable.

Define a new `GCPConfiguration` structure, move the credentials variable
into it and use it in `OSBuildJobImpl` instead.
This commit is contained in:
Tomáš Hozza 2022-09-23 12:54:17 +02:00 committed by Ondřej Budai
parent 13f0894094
commit cc53f5423e
2 changed files with 10 additions and 6 deletions

View file

@ -351,9 +351,9 @@ func main() {
// If the credentials are not provided in the configuration, then the
// worker will rely on the GCP library to authenticate using default means.
var gcpCredentials string
var gcpConfig GCPConfiguration
if config.GCP != nil {
gcpCredentials = config.GCP.Credentials
gcpConfig.Creds = config.GCP.Credentials
}
// If the credentials are not provided in the configuration, then the
@ -435,7 +435,7 @@ func main() {
Store: store,
Output: output,
KojiServers: kojiServers,
GCPCreds: gcpCredentials,
GCPConfig: gcpConfig,
AzureCreds: azureCredentials,
AWSCreds: awsCredentials,
AWSBucket: awsBucket,