Skip to content

Commit 30fd68c

Browse files
committed
libpod: rm some unused freebsd code
This fixes a bunch of "unused" linter warnings on freebsd. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 8754687 commit 30fd68c

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

libpod/networking_freebsd.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ import (
99
"fmt"
1010
"net"
1111
"os/exec"
12-
"path/filepath"
1312

1413
"github.com/containers/buildah/pkg/jail"
1514
"github.com/containers/common/libnetwork/types"
1615
"github.com/containers/podman/v5/libpod/define"
17-
"github.com/containers/storage/pkg/lockfile"
1816
"github.com/sirupsen/logrus"
1917
)
2018

@@ -46,38 +44,6 @@ type NetstatAddress struct {
4644
Collisions uint64 `json:"collisions"`
4745
}
4846

49-
type RootlessNetNS struct {
50-
dir string
51-
Lock *lockfile.LockFile
52-
}
53-
54-
// getPath will join the given path to the rootless netns dir
55-
func (r *RootlessNetNS) getPath(path string) string {
56-
return filepath.Join(r.dir, path)
57-
}
58-
59-
// Do - run the given function in the rootless netns.
60-
// It does not lock the rootlessCNI lock, the caller
61-
// should only lock when needed, e.g. for network operations.
62-
func (r *RootlessNetNS) Do(toRun func() error) error {
63-
return errors.New("not supported on freebsd")
64-
}
65-
66-
// Cleanup the rootless network namespace if needed.
67-
// It checks if we have running containers with the bridge network mode.
68-
// Cleanup() expects that r.Lock is locked
69-
func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
70-
return errors.New("not supported on freebsd")
71-
}
72-
73-
// GetRootlessNetNs returns the rootless netns object. If create is set to true
74-
// the rootless network namespace will be created if it does not already exist.
75-
// If called as root it returns always nil.
76-
// On success the returned RootlessCNI lock is locked and must be unlocked by the caller.
77-
func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
78-
return nil, nil
79-
}
80-
8147
func getSlirp4netnsIP(subnet *net.IPNet) (*net.IP, error) {
8248
return nil, errors.New("not implemented GetSlirp4netnsIP")
8349
}
@@ -264,7 +230,3 @@ func (c *Container) inspectJoinedNetworkNS(networkns string) (q types.StatusBloc
264230
func (c *Container) reloadRootlessRLKPortMapping() error {
265231
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
266232
}
267-
268-
func (c *Container) setupRootlessNetwork() error {
269-
return nil
270-
}

libpod/util_freebsd.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,12 @@
33
package libpod
44

55
import (
6-
"errors"
76
"syscall"
87

9-
spec "github.com/opencontainers/runtime-spec/specs-go"
108
"github.com/sirupsen/logrus"
119
"golang.org/x/sys/unix"
1210
)
1311

14-
// systemdSliceFromPath makes a new systemd slice under the given parent with
15-
// the given name.
16-
// The parent must be a slice. The name must NOT include ".slice"
17-
func systemdSliceFromPath(parent, name string, resources *spec.LinuxResources) (string, error) {
18-
return "", errors.New("not implemented systemdSliceFromPath")
19-
}
20-
21-
// deleteSystemdCgroup deletes the systemd cgroup at the given location
22-
func deleteSystemdCgroup(path string, resources *spec.LinuxResources) error {
23-
return nil
24-
}
25-
2612
// No equivalent on FreeBSD?
2713
func LabelVolumePath(path, mountLabel string) error {
2814
return nil

0 commit comments

Comments
 (0)