Skip to content

Commit

Permalink
pkg/config: override DefaultInitPath for FreeBSD
Browse files Browse the repository at this point in the history
FreeBSD packages typically install files under /usr/local on FreeBSD.

Signed-off-by: Doug Rabson <[email protected]>
  • Loading branch information
dfr committed Jun 12, 2023
1 parent 9635bc0 commit d6abc58
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,12 @@ image_copy_tmp_dir="storage"`

It("Test Capabilities call", func() {
// Given
// When
config, err := NewConfig("")
// Then
if runtime.GOOS != "linux" {
Skip(fmt.Sprintf("capabilities not supported on %s", runtime.GOOS))
}
// When
config, err := NewConfig("")
// Then
gomega.Expect(err).To(gomega.BeNil())
var addcaps, dropcaps []string
caps, err := config.Capabilities("0", addcaps, dropcaps)
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ const (
)

var (
// DefaultInitPath is the default path to the container-init binary.
DefaultInitPath = "/usr/libexec/podman/catatonit"
// DefaultInfraImage is the default image to run as infrastructure containers in pods.
DefaultInfraImage = ""
// DefaultRootlessSHMLockPath is the default path for rootless SHM locks.
Expand Down
7 changes: 7 additions & 0 deletions pkg/config/default_common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build !freebsd
// +build !freebsd

package config

// DefaultInitPath is the default path to the container-init binary.
var DefaultInitPath = "/usr/libexec/podman/catatonit"
3 changes: 3 additions & 0 deletions pkg/config/default_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package config

// DefaultInitPath is the default path to the container-init binary.
var DefaultInitPath = "/usr/local/libexec/podman/catatonit"

func getDefaultCgroupsMode() string {
return "enabled"
}
Expand Down

0 comments on commit d6abc58

Please sign in to comment.