Skip to content

Ensure exec.Cmd.Path and exec.Cmd.Args[0] consistency #174

Description

Create a factory function for exec.Cmd so that we do not have to do the following all over the codebase

cmd := exec.Command("docker", args...)
// exec.Command resolves cmd.Path via LookPath but leaves cmd.Args[0] as
// the original "docker" string. Align Args[0] with the resolved Path so
// downstream consumers and child-process
// argv[0] observers see a consistent, fully-qualified command name.
if cmd.Path != "" {
	cmd.Args[0] = cmd.Path
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    reliabilityIssue makes DCP unreliable

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions