libpod: rm some unused freebsd code

This fixes a bunch of "unused" linter warnings on freebsd.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-04-01 15:00:38 -07:00
parent 8754687b55
commit 30fd68cb23
2 changed files with 0 additions and 52 deletions

View File

@ -9,12 +9,10 @@ import (
"fmt"
"net"
"os/exec"
"path/filepath"
"github.com/containers/buildah/pkg/jail"
"github.com/containers/common/libnetwork/types"
"github.com/containers/podman/v5/libpod/define"
"github.com/containers/storage/pkg/lockfile"
"github.com/sirupsen/logrus"
)
@ -46,38 +44,6 @@ type NetstatAddress struct {
Collisions uint64 `json:"collisions"`
}
type RootlessNetNS struct {
dir string
Lock *lockfile.LockFile
}
// getPath will join the given path to the rootless netns dir
func (r *RootlessNetNS) getPath(path string) string {
return filepath.Join(r.dir, path)
}
// Do - run the given function in the rootless netns.
// It does not lock the rootlessCNI lock, the caller
// should only lock when needed, e.g. for network operations.
func (r *RootlessNetNS) Do(toRun func() error) error {
return errors.New("not supported on freebsd")
}
// Cleanup the rootless network namespace if needed.
// It checks if we have running containers with the bridge network mode.
// Cleanup() expects that r.Lock is locked
func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
return errors.New("not supported on freebsd")
}
// GetRootlessNetNs returns the rootless netns object. If create is set to true
// the rootless network namespace will be created if it does not already exist.
// If called as root it returns always nil.
// On success the returned RootlessCNI lock is locked and must be unlocked by the caller.
func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
return nil, nil
}
func getSlirp4netnsIP(subnet *net.IPNet) (*net.IP, error) {
return nil, errors.New("not implemented GetSlirp4netnsIP")
}
@ -264,7 +230,3 @@ func (c *Container) inspectJoinedNetworkNS(networkns string) (q types.StatusBloc
func (c *Container) reloadRootlessRLKPortMapping() error {
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
}
func (c *Container) setupRootlessNetwork() error {
return nil
}

View File

@ -3,26 +3,12 @@
package libpod
import (
"errors"
"syscall"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
// systemdSliceFromPath makes a new systemd slice under the given parent with
// the given name.
// The parent must be a slice. The name must NOT include ".slice"
func systemdSliceFromPath(parent, name string, resources *spec.LinuxResources) (string, error) {
return "", errors.New("not implemented systemdSliceFromPath")
}
// deleteSystemdCgroup deletes the systemd cgroup at the given location
func deleteSystemdCgroup(path string, resources *spec.LinuxResources) error {
return nil
}
// No equivalent on FreeBSD?
func LabelVolumePath(path, mountLabel string) error {
return nil