Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions common/libnetwork/slirp4netns/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ package slirp4netns
import "net"

const (
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
BinaryName = "slirp4netns"

// defaultMTU the default MTU override.
defaultMTU = 65520

// default slirp4ns subnet.
defaultSubnet = "10.0.2.0/24"
BinaryName = "slirp4netns"
)

// SetupResult return type from Setup().
Expand Down
11 changes: 11 additions & 0 deletions common/libnetwork/slirp4netns/const_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package slirp4netns

const (
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"

// defaultMTU the default MTU override.
defaultMTU = 65520

// default slirp4ns subnet.
defaultSubnet = "10.0.2.0/24"
)
8 changes: 0 additions & 8 deletions common/pkg/cgroups/cgroups_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

package cgroups

import (
"os"
)

// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
func IsCgroup2UnifiedMode() (bool, error) {
return false, nil
Expand All @@ -16,7 +12,3 @@ func IsCgroup2UnifiedMode() (bool, error) {
func UserOwnsCurrentSystemdCgroup() (bool, error) {
return false, nil
}

func rmDirRecursively(path string) error {
return os.RemoveAll(path)
}
2 changes: 1 addition & 1 deletion common/pkg/cgroupv2/cgroups_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package cgroupv2

// Enabled returns whether we are running on cgroup v2
// Enabled returns whether we are running on cgroup v2.
func Enabled() (bool, error) {
return false, nil
}
2 changes: 1 addition & 1 deletion common/pkg/config/config_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func selinuxEnabled() bool {
}

// Capabilities returns the capabilities parses the Add and Drop capability
// list from the default capabilities for the container
// list from the default capabilities for the container.
func (c *Config) Capabilities(user string, addCapabilities, dropCapabilities []string) ([]string, error) {
return nil, nil
}
10 changes: 0 additions & 10 deletions common/pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ var (
// helper binary in a different location.
additionalHelperBinariesDir string

defaultUnixComposeProviders = []string{
"$HOME/.docker/cli-plugins/docker-compose",
"/usr/local/lib/docker/cli-plugins/docker-compose",
"/usr/local/libexec/docker/cli-plugins/docker-compose",
"/usr/lib/docker/cli-plugins/docker-compose",
"/usr/libexec/docker/cli-plugins/docker-compose",
"docker-compose",
"podman-compose",
}

defaultContainerEnv = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
)

Expand Down
4 changes: 0 additions & 4 deletions common/pkg/config/default_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ func getLibpodTmpDir() string {
func getDefaultMachineVolumes() []string {
return []string{"$HOME:$HOME"}
}

func getDefaultComposeProviders() []string {
return defaultUnixComposeProviders
}
2 changes: 1 addition & 1 deletion common/pkg/config/default_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func getLibpodTmpDir() string {
return "/run/libpod"
}

// getDefaultMachineVolumes returns default mounted volumes (possibly with env vars, which will be expanded)
// getDefaultMachineVolumes returns default mounted volumes (possibly with env vars, which will be expanded).
func getDefaultMachineVolumes() []string {
return []string{
"/Users:/Users",
Expand Down
4 changes: 0 additions & 4 deletions common/pkg/config/default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,3 @@ func getLibpodTmpDir() string {
func getDefaultMachineVolumes() []string {
return []string{"$HOME:$HOME"}
}

func getDefaultComposeProviders() []string {
return defaultUnixComposeProviders
}
17 changes: 17 additions & 0 deletions common/pkg/config/default_unix_notdarwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//go:build linux || freebsd || netbsd || openbsd

package config

var defaultUnixComposeProviders = []string{
"$HOME/.docker/cli-plugins/docker-compose",
"/usr/local/lib/docker/cli-plugins/docker-compose",
"/usr/local/libexec/docker/cli-plugins/docker-compose",
"/usr/lib/docker/cli-plugins/docker-compose",
"/usr/libexec/docker/cli-plugins/docker-compose",
"docker-compose",
"podman-compose",
}

func getDefaultComposeProviders() []string {
return defaultUnixComposeProviders
}
12 changes: 1 addition & 11 deletions common/pkg/config/default_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ package config

import "os"

// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
return false, nil
}

// getDefaultProcessLimits returns the nofile and nproc for the current process in ulimits format
func getDefaultProcessLimits() []string {
return []string{}
}

// getDefaultTmpDir for linux
// getDefaultTmpDir for linux.
func getDefaultTmpDir() string {
// first check the TMPDIR env var
if path, found := os.LookupEnv("TMPDIR"); found {
Expand Down
10 changes: 0 additions & 10 deletions common/pkg/config/default_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ import (
"go.podman.io/storage/pkg/homedir"
)

// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
return false, nil
}

// getDefaultProcessLimits returns the nofile and nproc for the current process in ulimits format
func getDefaultProcessLimits() []string {
return []string{}
}

// getDefaultTmpDir for windows
func getDefaultTmpDir() string {
// first check the Temp env var
Expand Down
2 changes: 1 addition & 1 deletion common/pkg/manifests/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestAddInstance(t *testing.T) {
t.Fatalf("adding an instance without platform info failed in %s: %v", version, err)
}
o, err := list.findOCIv1(manifestDigest)
if o == nil || err != nil {
if err != nil {
t.Fatalf("adding an instance failed in %s: %v", version, err)
}
if o.Platform != nil {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions common/pkg/seccomp/seccomp_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (

var errNotSupported = errors.New("seccomp not enabled in this build")

// LoadProfile returns an error on unsupported systems
// LoadProfile returns an error on unsupported systems.
func LoadProfile(body string, rs *specs.Spec) (*specs.LinuxSeccomp, error) {
return nil, errNotSupported
}

// GetDefaultProfile returns an error on unsupported systems
// GetDefaultProfile returns an error on unsupported systems.
func GetDefaultProfile(rs *specs.Spec) (*specs.LinuxSeccomp, error) {
return nil, errNotSupported
}
Expand All @@ -29,7 +29,7 @@ func LoadProfileFromBytes(body []byte, rs *specs.Spec) (*specs.LinuxSeccomp, err
return nil, errNotSupported
}

// LoadProfileFromConfig takes a Seccomp struct and a spec to retrieve a LinuxSeccomp
// LoadProfileFromConfig takes a Seccomp struct and a spec to retrieve a LinuxSeccomp.
func LoadProfileFromConfig(config *Seccomp, specgen *specs.Spec) (*specs.LinuxSeccomp, error) {
return nil, errNotSupported
}
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion common/pkg/timezone/timezone_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func openDirectory(path string) (fd int, err error) {
const O_PATH = 0x00400000
// FIXME: If O_PATH is not defined on a platform, it probably doesn't work. E.g. on macOS, this is actually O_DSYNC.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was just added for freebsd so I guess we should just make the package compile there since we won't support this code path elsewhere.

const O_PATH = 0x00400000 //nolint:staticcheck // ST1003: should not use ALL_CAPS
return unix.Open(path, unix.O_RDONLY|O_PATH|unix.O_CLOEXEC, 0)
}