From 37e6304daeb780688ffdbedd316efcbbbef5bdef Mon Sep 17 00:00:00 2001 From: Zhenya Tikhonov Date: Mon, 2 Dec 2024 18:18:06 +0400 Subject: [PATCH] fix(user-agent): do not append Runtime version if absent --- venona/cmd/start.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/venona/cmd/start.go b/venona/cmd/start.go index 809361cf..c09ff3e5 100644 --- a/venona/cmd/start.go +++ b/venona/cmd/start.go @@ -230,9 +230,13 @@ func run(options startOptions) { httpClient.Transport = monitor.NewRoundTripper(httpClient.Transport) + userAgent := fmt.Sprintf("cf-classic-runner/%s", version) + if runtimeVersion := os.Getenv("RUNTIME_CHART_VERSION"); runtimeVersion != "" { + userAgent += fmt.Sprintf(" cf-classic-runtime/%s", runtimeVersion) + } httpHeaders := http.Header{} { - httpHeaders.Add("User-Agent", fmt.Sprintf("cf-classic-runner/%s,cf-classic-runtime/%s", version, os.Getenv("RUNTIME_CHART_VERSION"))) + httpHeaders.Add("User-Agent", userAgent) } cf = codefresh.New(codefresh.Options{