mirror of
https://github.com/containers/podman.git
synced 2025-10-19 12:12:36 +08:00
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:
@ -9,12 +9,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/containers/buildah/pkg/jail"
|
"github.com/containers/buildah/pkg/jail"
|
||||||
"github.com/containers/common/libnetwork/types"
|
"github.com/containers/common/libnetwork/types"
|
||||||
"github.com/containers/podman/v5/libpod/define"
|
"github.com/containers/podman/v5/libpod/define"
|
||||||
"github.com/containers/storage/pkg/lockfile"
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,38 +44,6 @@ type NetstatAddress struct {
|
|||||||
Collisions uint64 `json:"collisions"`
|
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) {
|
func getSlirp4netnsIP(subnet *net.IPNet) (*net.IP, error) {
|
||||||
return nil, errors.New("not implemented GetSlirp4netnsIP")
|
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 {
|
func (c *Container) reloadRootlessRLKPortMapping() error {
|
||||||
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
|
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Container) setupRootlessNetwork() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -3,26 +3,12 @@
|
|||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/sys/unix"
|
"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?
|
// No equivalent on FreeBSD?
|
||||||
func LabelVolumePath(path, mountLabel string) error {
|
func LabelVolumePath(path, mountLabel string) error {
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user