diff --git a/cmd/osbuild-worker/jobimpl-osbuild.go b/cmd/osbuild-worker/jobimpl-osbuild.go index 206f23427..20b2ebc69 100644 --- a/cmd/osbuild-worker/jobimpl-osbuild.go +++ b/cmd/osbuild-worker/jobimpl-osbuild.go @@ -31,6 +31,10 @@ import ( "github.com/osbuild/osbuild-composer/internal/worker/clienterrors" ) +type GCPConfiguration struct { + Creds string +} + type S3Configuration struct { Creds string Endpoint string @@ -52,7 +56,7 @@ type OSBuildJobImpl struct { Store string Output string KojiServers map[string]kojiServer - GCPCreds string + GCPConfig GCPConfiguration AzureCreds *azure.Credentials AWSCreds string AWSBucket string @@ -160,9 +164,9 @@ func (impl *OSBuildJobImpl) getGCP(credentials []byte) (*gcp.GCP, error) { if credentials != nil { logrus.Info("[GCP] 🔑 using credentials provided with the job request") return gcp.New(credentials) - } else if impl.GCPCreds != "" { + } else if impl.GCPConfig.Creds != "" { logrus.Info("[GCP] 🔑 using credentials from the worker configuration") - return gcp.NewFromFile(impl.GCPCreds) + return gcp.NewFromFile(impl.GCPConfig.Creds) } else { logrus.Info("[GCP] 🔑 using Application Default Credentials via Google library") return gcp.New(nil) diff --git a/cmd/osbuild-worker/main.go b/cmd/osbuild-worker/main.go index 7c5478682..46dac35d6 100644 --- a/cmd/osbuild-worker/main.go +++ b/cmd/osbuild-worker/main.go @@ -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,