From cb4421b69f10fd707e44ec0c9c9f94f4894f41a2 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Wed, 25 Mar 2020 02:45:59 +0100 Subject: [PATCH] =?UTF-8?q?worker:=20remoteAddress=20=E2=86=92=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/osbuild-worker/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/osbuild-worker/main.go b/cmd/osbuild-worker/main.go index c16e3a3b5..b45cac087 100644 --- a/cmd/osbuild-worker/main.go +++ b/cmd/osbuild-worker/main.go @@ -56,7 +56,7 @@ func createTLSConfig(config *connectionConfig) (*tls.Config, error) { }, nil } -func NewClient(remoteAddress string, conf *tls.Config) *ComposerClient { +func NewClient(address string, conf *tls.Config) *ComposerClient { client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: conf, @@ -70,7 +70,7 @@ func NewClient(remoteAddress string, conf *tls.Config) *ComposerClient { scheme = "https" } - return &ComposerClient{client, scheme, remoteAddress} + return &ComposerClient{client, scheme, address} } func NewClientUnix(path string) *ComposerClient { @@ -177,13 +177,13 @@ func handleJob(client *ComposerClient) error { } func main() { - var remoteAddress string - flag.StringVar(&remoteAddress, "remote", "", "Connect to a remote composer using the specified address") + var address string + flag.StringVar(&address, "remote", "", "Connect to a remote composer using the specified address") flag.Parse() var client *ComposerClient - if remoteAddress != "" { - remoteAddress = fmt.Sprintf("%s:%d", remoteAddress, RemoteWorkerPort) + if address != "" { + address = fmt.Sprintf("%s:%d", address, RemoteWorkerPort) conf, err := createTLSConfig(&connectionConfig{ CACertFile: "/etc/osbuild-composer/ca-crt.pem", @@ -194,7 +194,7 @@ func main() { log.Fatalf("Error creating TLS config: %v", err) } - client = NewClient(remoteAddress, conf) + client = NewClient(address, conf) } else { client = NewClientUnix("/run/osbuild-composer/job.socket") }