Skip to content

Commit 65acb20

Browse files
committed
cmd/{buildlet,runqemubuildlet}: use a functional healthAddr default
Reverse buildlets now listen publicly, which allows the QEMU host forwarding to route to the buildlet. Also, print a newline at the end of the healthz response for legibility. For golang/go#47018 Change-Id: I71ae1bf4d7cbee4867c42e863cb9f8c2569e1b69 Reviewed-on: https://go-review.googlesource.com/c/build/+/336590 Trust: Alexander Rakoczy <[email protected]> Run-TryBot: Alexander Rakoczy <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 75882ed commit 65acb20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/buildlet/buildlet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var (
5757
reverseType = flag.String("reverse-type", "", "if non-empty, go into reverse mode where the buildlet dials the coordinator instead of listening for connections. The value is the dashboard/builders.go Hosts map key, naming a HostConfig. This buildlet will receive work for any BuildConfig specifying this named HostConfig.")
5858
coordinator = flag.String("coordinator", "localhost:8119", "address of coordinator, in production use farmer.golang.org. Only used in reverse mode.")
5959
hostname = flag.String("hostname", "", "hostname to advertise to coordinator for reverse mode; default is actual hostname")
60-
healthAddr = flag.String("health-addr", "localhost:8080", "For reverse buildlets, address to listen for /healthz requests separately from the reverse dialer to the coordinator.")
60+
healthAddr = flag.String("health-addr", "0.0.0.0:8080", "For reverse buildlets, address to listen for /healthz requests separately from the reverse dialer to the coordinator.")
6161
)
6262

6363
// Bump this whenever something notable happens, or when another
@@ -2013,7 +2013,7 @@ func runOrLog(cmd *exec.Cmd) {
20132013

20142014
// handleHealthz always returns 200 OK.
20152015
func handleHealthz(w http.ResponseWriter, _ *http.Request) {
2016-
w.Write([]byte("ok"))
2016+
fmt.Fprintln(w, "ok")
20172017
}
20182018

20192019
// serveReverseHealth serves /healthz requests on healthAddr for

cmd/runqemubuildlet/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func windows10Cmd(base string) *exec.Cmd {
9292
"-device", "usb-mouse,bus=usb-bus.0",
9393
"-device", "usb-kbd,bus=usb-bus.0",
9494
"-device", "virtio-net-pci,netdev=net0",
95-
"-netdev", "user,id=net0,hostfwd=tcp::8080-:8080",
95+
"-netdev", "user,id=net0,hostfwd=tcp:127.0.0.1:8080-:8080",
9696
"-bios", filepath.Join(base, "Images/QEMU_EFI.fd"),
9797
"-device", "nvme,drive=drive0,serial=drive0,bootindex=0",
9898
"-drive", fmt.Sprintf("if=none,media=disk,id=drive0,file=%s,cache=writethrough", filepath.Join(base, "Images/win10.qcow2")),

0 commit comments

Comments
 (0)