Skip to content

Commit 8946b35

Browse files
authored
fix: reduce curl container log output to single line status #654
1 parent b377daf commit 8946b35

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/resources/containers/curl_start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewStartContainer(hostnames []string, image string, imagePullPolicy corev1.
2525

2626
var parts []string
2727
for _, hostname := range hostnames {
28-
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s'", net.JoinHostPort(hostname, "6565"), req))
28+
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s' -s -w '\n{\"http_code\":%%{http_code},\"time_total\":%%{time_total},\"time_starttransfer\":%%{time_starttransfer},\"url\":\"%%{url_effective}\",\"remote_ip\":\"%%{remote_ip}\",\"errormsg\":\"%%{errormsg}\"}'", net.JoinHostPort(hostname, "6565"), req))
2929
}
3030

3131
return corev1.Container{

pkg/resources/containers/curl_stop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewStopContainer(hostnames []string, image string, imagePullPolicy corev1.P
2525

2626
var parts []string
2727
for _, hostname := range hostnames {
28-
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s'", net.JoinHostPort(hostname, "6565"), req))
28+
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s' -s -w '\n{\"http_code\":%%{http_code},\"time_total\":%%{time_total},\"time_starttransfer\":%%{time_starttransfer},\"url\":\"%%{url_effective}\",\"remote_ip\":\"%%{remote_ip}\",\"errormsg\":\"%%{errormsg}\"}'", net.JoinHostPort(hostname, "6565"), req))
2929
}
3030

3131
return corev1.Container{

0 commit comments

Comments
 (0)