From 687c96e408083250ab60423abcc80f81faaac73e Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Fri, 19 Nov 2021 11:22:30 -0500 Subject: [PATCH] Give receptor subprocess a nodeID When work units are started, a separate receptor process is ran If this receptor process does not have a node ID, receptor will try to use os.hostname. If hostname begins with "localhost", receptor will error out. To avoid this scenario, we should just give the receptor a nodeID. Since this receptor process is not joining a mesh, the name really doesn't matter. --- pkg/workceptor/command.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/workceptor/command.go b/pkg/workceptor/command.go index 7c3d2d924..3869b8f15 100644 --- a/pkg/workceptor/command.go +++ b/pkg/workceptor/command.go @@ -229,7 +229,9 @@ func (cw *commandUnit) Start() error { level := logger.GetLogLevel() levelName, _ := logger.LogLevelToName(level) cw.UpdateBasicStatus(WorkStatePending, "Launching command runner", 0) - cmd := exec.Command(os.Args[0], "--log-level", levelName, "--command-runner", + cmd := exec.Command(os.Args[0], "--node", "id=worker", + "--log-level", levelName, + "--command-runner", fmt.Sprintf("command=%s", cw.command), fmt.Sprintf("params=%s", cw.Status().ExtraData.(*commandExtraData).Params), fmt.Sprintf("unitdir=%s", cw.UnitDir()))