Skip to content

Commit

Permalink
Prioritize addtionalHelperBinariesDir over default dirs
Browse files Browse the repository at this point in the history
When addtionalHelperBinariesDir is set, first search that path for helper binaries, then the default locations.

Signed-off-by: Ashley Cui <[email protected]>
  • Loading branch information
ashley-cui committed Nov 29, 2023
1 parent f64de41 commit 91ee74b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/config/config_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func ifRootlessConfigPath() (string, error) {
}

var defaultHelperBinariesDir = []string{
// Relative to the binary directory
"$BINDIR/../libexec/podman",
// Homebrew install paths
"/usr/local/opt/podman/libexec/podman",
"/opt/homebrew/opt/podman/libexec/podman",
Expand All @@ -42,6 +44,4 @@ var defaultHelperBinariesDir = []string{
"/usr/local/lib/podman",
"/usr/libexec/podman",
"/usr/lib/podman",
// Relative to the binary directory
"$BINDIR/../libexec/podman",
}
3 changes: 2 additions & 1 deletion pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ func defaultEngineConfig() (*EngineConfig, error) {

c.HelperBinariesDir.Set(defaultHelperBinariesDir)
if additionalHelperBinariesDir != "" {
c.HelperBinariesDir.Set(append(c.HelperBinariesDir.Get(), additionalHelperBinariesDir))
// Prioritize addtionalHelperBinariesDir over defaults.
c.HelperBinariesDir.Set(append([]string{additionalHelperBinariesDir}, c.HelperBinariesDir.Get()...))
}
c.HooksDir.Set(DefaultHooksDirs)
c.ImageDefaultTransport = _defaultTransport
Expand Down

0 comments on commit 91ee74b

Please sign in to comment.