Skip to content

Commit 27a3c17

Browse files
committed
Avoid unused symbols on non-Linux
Signed-off-by: Miloslav Trmač <[email protected]>
1 parent 7678633 commit 27a3c17

File tree

9 files changed

+29
-54
lines changed

9 files changed

+29
-54
lines changed

common/libnetwork/slirp4netns/const.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@ package slirp4netns
33
import "net"
44

55
const (
6-
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
7-
BinaryName = "slirp4netns"
8-
9-
// defaultMTU the default MTU override.
10-
defaultMTU = 65520
11-
12-
// default slirp4ns subnet.
13-
defaultSubnet = "10.0.2.0/24"
6+
BinaryName = "slirp4netns"
147
)
158

169
// SetupResult return type from Setup().
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package slirp4netns
2+
3+
const (
4+
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
5+
6+
// defaultMTU the default MTU override.
7+
defaultMTU = 65520
8+
9+
// default slirp4ns subnet.
10+
defaultSubnet = "10.0.2.0/24"
11+
)

common/pkg/cgroups/cgroups_unsupported.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
package cgroups
44

5-
import (
6-
"os"
7-
)
8-
95
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
106
func IsCgroup2UnifiedMode() (bool, error) {
117
return false, nil
@@ -16,7 +12,3 @@ func IsCgroup2UnifiedMode() (bool, error) {
1612
func UserOwnsCurrentSystemdCgroup() (bool, error) {
1713
return false, nil
1814
}
19-
20-
func rmDirRecursively(path string) error {
21-
return os.RemoveAll(path)
22-
}

common/pkg/config/default.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,6 @@ var (
145145
// helper binary in a different location.
146146
additionalHelperBinariesDir string
147147

148-
defaultUnixComposeProviders = []string{
149-
"$HOME/.docker/cli-plugins/docker-compose",
150-
"/usr/local/lib/docker/cli-plugins/docker-compose",
151-
"/usr/local/libexec/docker/cli-plugins/docker-compose",
152-
"/usr/lib/docker/cli-plugins/docker-compose",
153-
"/usr/libexec/docker/cli-plugins/docker-compose",
154-
"docker-compose",
155-
"podman-compose",
156-
}
157-
158148
defaultContainerEnv = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
159149
)
160150

common/pkg/config/default_bsd.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,3 @@ func getLibpodTmpDir() string {
2828
func getDefaultMachineVolumes() []string {
2929
return []string{"$HOME:$HOME"}
3030
}
31-
32-
func getDefaultComposeProviders() []string {
33-
return defaultUnixComposeProviders
34-
}

common/pkg/config/default_linux.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,3 @@ func getLibpodTmpDir() string {
2929
func getDefaultMachineVolumes() []string {
3030
return []string{"$HOME:$HOME"}
3131
}
32-
33-
func getDefaultComposeProviders() []string {
34-
return defaultUnixComposeProviders
35-
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//go:build linux || freebsd || netbsd || openbsd
2+
3+
package config
4+
5+
var defaultUnixComposeProviders = []string{
6+
"$HOME/.docker/cli-plugins/docker-compose",
7+
"/usr/local/lib/docker/cli-plugins/docker-compose",
8+
"/usr/local/libexec/docker/cli-plugins/docker-compose",
9+
"/usr/lib/docker/cli-plugins/docker-compose",
10+
"/usr/libexec/docker/cli-plugins/docker-compose",
11+
"docker-compose",
12+
"podman-compose",
13+
}
14+
15+
func getDefaultComposeProviders() []string {
16+
return defaultUnixComposeProviders
17+
}

common/pkg/config/default_unsupported.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ package config
44

55
import "os"
66

7-
// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
8-
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
9-
return false, nil
10-
}
11-
12-
// getDefaultProcessLimits returns the nofile and nproc for the current process in ulimits format.
13-
func getDefaultProcessLimits() []string {
14-
return []string{}
15-
}
16-
177
// getDefaultTmpDir for linux.
188
func getDefaultTmpDir() string {
199
// first check the TMPDIR env var

common/pkg/config/default_windows.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ import (
99
"go.podman.io/storage/pkg/homedir"
1010
)
1111

12-
// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
13-
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
14-
return false, nil
15-
}
16-
17-
// getDefaultProcessLimits returns the nofile and nproc for the current process in ulimits format
18-
func getDefaultProcessLimits() []string {
19-
return []string{}
20-
}
21-
2212
// getDefaultTmpDir for windows
2313
func getDefaultTmpDir() string {
2414
// first check the Temp env var

0 commit comments

Comments
 (0)