Skip to content

Commit f906deb

Browse files
Fix PATH on Windows (#197)
We should be using the platform-specific path list seperator
1 parent 86497c2 commit f906deb

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ By following these guidelines, we can easily determine which changes should be i
1010

1111
## Edge
1212

13+
- [#197](https://github.com/circleci/runner-init/pull/197) Fix `%PATH%` on Windows by using the OS-specific path list separator.
1314
- [#133](https://github.com/circleci/runner-init/pull/133) Don't re-handle task errors. If GOAT handles a task error (either with an infra-fail or retry), don't exit with a nonzero status code. Doing so causes container agent to overwrite the original error message in the UI.
1415
- [#98](https://github.com/circleci/runner-init/pull/98) [INTERNAL] A small refactor to the builds and Dockerfiles in preparation for adding Windows support.
1516
- [#96](https://github.com/circleci/runner-init/pull/96) [INTERNAL] Introduce initial support for Windows containers. Additional follow-up work is needed to fully support Windows, including the implementation of a smoke test and supporting service containers on Windows, which is a known limitation at this time.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To address these issues, we transitioned to an in-container orchestration agent,
2020
### Key Improvements
2121
- **Init container setup** - GOAT’s design uses an init container to copy the GOAT and task agent binaries to a shared ephemeral volume with the primary container. By using an init image, the binaries are cached on the node, rather than relying on container agent's local storage and the specific node it is on, improving startup efficiency.
2222
- **GOAT as PID 1** - In Kubernetes, PID 1 is special, as it can handle container signals directly and determines the lifecycle of the container. This allows for GOAT to propagate signals to task agent, manage child process termination and reaping, and ensure a clean container exit on task completion, allowing container agent to efficiently clean up the task Pod.
23-
- **Improved health checks** - GOAT provides built-in health checks on port `7623` for liveness probes, replacing the previous reliance on `exec` probes, which required a container shell and were prone to false positives.
23+
- **Improved health cdhecks** - GOAT provides built-in health checks on port `7623` for liveness probes, replacing the previous reliance on `exec` probes, which required a container shell and were prone to false positives.
2424
- **Shell independence** - GOAT encapsulates all task environment setup and management functions, eliminating reliance on the container’s shell, which wasn't always POSIX compliant. This extends container runner's compatability with a larger assortment of images that can be used for a task.
2525
- **Better error reporting** - GOAT’s direct operation within the primary container provides better insight into task agent interruptions and failures, allowing for more detailed and actionable error reporting than was possible with the previous design’s remote execution model.
2626

task/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ func (c *Config) Agent() Agent {
6262

6363
cmd := append(strings.Split(c.TaskAgentPath, " "), args...)
6464

65-
env := []string{fmt.Sprintf("PATH=%s:%s", os.Getenv("PATH"), filepath.Dir(c.TaskAgentPath))}
65+
env := []string{fmt.Sprintf("PATH=%s%c%s",
66+
os.Getenv("PATH"), os.PathListSeparator, filepath.Dir(c.TaskAgentPath))}
6667

6768
return Agent{
6869
Cmd: cmd,

task/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func Test_Agent(t *testing.T) {
9393
}
9494

9595
expectedEnv := []string{
96-
fmt.Sprintf("PATH=%s:%s", os.Getenv("PATH"), filepath.Dir("/path/to/agent")),
96+
fmt.Sprintf("PATH=%s%c%s", os.Getenv("PATH"), os.PathListSeparator, filepath.Dir("/path/to/agent")),
9797
}
9898

9999
expectedAgent := Agent{

0 commit comments

Comments
 (0)