mirror of
https://github.com/containers/podman.git
synced 2025-06-26 21:07:02 +08:00
Merge pull request #11628 from Luap99/remove-unsued-code
Remove unused code from libpod
This commit is contained in:
@ -1,13 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
// replaceNetNS is exclusive to the Linux platform and is a no-op elsewhere
|
|
||||||
func replaceNetNS(netNSPath string, ctr *Container, newState *ContainerState) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// getNetNSPath is exclusive to the Linux platform and is a no-op elsewhere
|
|
||||||
func getNetNSPath(ctr *Container) string {
|
|
||||||
return ""
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *Container) copyFromArchive(ctx context.Context, path string, reader io.Reader) (func() error, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) copyToArchive(ctx context.Context, path string, writer io.Writer) (func() error, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
"github.com/containers/podman/v3/pkg/lookup"
|
|
||||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *Container) mountSHM(shmOptions string) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) unmountSHM(mount string) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) prepare() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) cleanupNetwork() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) checkpoint(ctx context.Context, options ContainerCheckpointOptions) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) restore(ctx context.Context, options ContainerCheckpointOptions) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) copyOwnerAndPerms(source, dest string) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) getOCICgroupPath() (string, error) {
|
|
||||||
return "", define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) cleanupOverlayMounts() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) reloadNetwork() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) getUserOverrides() *lookup.Overrides {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix ownership and permissions of the specified volume if necessary.
|
|
||||||
func (c *Container) fixVolumePermissions(v *ContainerNamedVolume) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *Container) stat(ctx context.Context, containerMountPoint string, containerPath string) (*define.FileInfo, string, string, error) {
|
|
||||||
return nil, "", "", nil
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import "github.com/containers/podman/v3/libpod/define"
|
|
||||||
|
|
||||||
// Top gathers statistics about the running processes in a container. It returns a
|
|
||||||
// []string for output
|
|
||||||
func (c *Container) Top(descriptors []string) ([]string, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetContainerPidInformation returns process-related data of all processes in
|
|
||||||
// the container. The output data can be controlled via the `descriptors`
|
|
||||||
// argument which expects format descriptors and supports all AIXformat
|
|
||||||
// descriptors of ps (1) plus some additional ones to for instance inspect the
|
|
||||||
// set of effective capabilities. Each element in the returned string slice
|
|
||||||
// is a tab-separated string.
|
|
||||||
//
|
|
||||||
// For more details, please refer to github.com/containers/psgo.
|
|
||||||
func (c *Container) GetContainerPidInformation(descriptors []string) ([]string, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
type containerPlatformState struct{}
|
|
@ -1,21 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import "github.com/containers/podman/v3/libpod/define"
|
|
||||||
|
|
||||||
// createTimer systemd timers for healthchecks of a container
|
|
||||||
func (c *Container) createTimer() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// startTimer starts a systemd timer for the healthchecks
|
|
||||||
func (c *Container) startTimer() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// removeTimer removes the systemd timer and unit files
|
|
||||||
// for the container
|
|
||||||
func (c *Container) removeTimer() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
cnitypes "github.com/containernetworking/cni/pkg/types/current"
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (r *Runtime) setupRootlessNetNS(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) setupSlirp4netns(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) setupNetNS(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) teardownNetNS(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) createNetNS(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) reloadContainerNetwork(ctr *Container) ([]*cnitypes.Result, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func getCNINetworksDir() (string, error) {
|
|
||||||
return "", define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
//+build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *Container) attach(streams *define.AttachStreams, keys string, resize <-chan define.TerminalSize, startContainer bool, started chan bool, attachRdy chan<- bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Container) attachToExec(streams *define.AttachStreams, keys string, resize <-chan define.TerminalSize, sessionID string, startFd *os.File, attachFd *os.File) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,132 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/containers/common/pkg/config"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
osNotSupported = "Not supported on this OS"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ConmonOCIRuntime is not supported on this OS.
|
|
||||||
type ConmonOCIRuntime struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
// newConmonOCIRuntime is not supported on this OS.
|
|
||||||
func newConmonOCIRuntime(name string, paths []string, conmonPath string, runtimeFlags []string, runtimeCfg *config.Config) (OCIRuntime, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// Name is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) Name() string {
|
|
||||||
return osNotSupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// Path is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) Path() string {
|
|
||||||
return osNotSupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) CreateContainer(ctr *Container, restoreOptions *ContainerCheckpointOptions) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateContainerStatus is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container, useRuntime bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// StartContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) StartContainer(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// KillContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) KillContainer(ctr *Container, signal uint, all bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// StopContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) StopContainer(ctr *Container, timeout uint, all bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeleteContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) DeleteContainer(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// PauseContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) PauseContainer(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnpauseContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) UnpauseContainer(ctr *Container) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExecContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) ExecContainer(ctr *Container, sessionID string, options *ExecOptions) (int, chan error, error) {
|
|
||||||
return -1, nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExecStopContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) ExecStopContainer(ctr *Container, sessionID string, timeout uint) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// CheckpointContainer is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options ContainerCheckpointOptions) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// SupportsCheckpoint is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) SupportsCheckpoint() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// SupportsJSONErrors is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) SupportsJSONErrors() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// SupportsNoCgroups is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) SupportsNoCgroups() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// AttachSocketPath is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) AttachSocketPath(ctr *Container) (string, error) {
|
|
||||||
return "", define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExecAttachSocketPath is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) ExecAttachSocketPath(ctr *Container, sessionID string) (string, error) {
|
|
||||||
return "", define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExitFilePath is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) ExitFilePath(ctr *Container) (string, error) {
|
|
||||||
return "", define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// RuntimeInfo is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) RuntimeInfo() (*define.ConmonInfo, *define.OCIRuntimeInfo, error) {
|
|
||||||
return nil, nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
// Package is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) Package() string {
|
|
||||||
return osNotSupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// ConmonPackage is not supported on this OS.
|
|
||||||
func (r *ConmonOCIRuntime) ConmonPackage() string {
|
|
||||||
return osNotSupported
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import "github.com/containers/podman/v3/libpod/define"
|
|
||||||
|
|
||||||
// GetPodPidInformation is exclusive to linux
|
|
||||||
func (p *Pod) GetPodPidInformation(descriptors []string) ([]string, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (r *Runtime) migrate(ctx context.Context) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) stopPauseProcess() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewPod makes a new, empty pod
|
|
||||||
func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, error) {
|
|
||||||
return nil, define.ErrOSNotSupported
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) error {
|
|
||||||
return define.ErrOSNotSupported
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (r *Runtime) removeVolume(ctx context.Context, v *Volume, force bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption) (*Volume, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Runtime) NewVolume(ctx context.Context, options ...VolumeCreateOption) (*Volume, error) {
|
|
||||||
return nil, define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import "github.com/containers/podman/v3/libpod/define"
|
|
||||||
|
|
||||||
// GetContainerStats gets the running stats for a given container
|
|
||||||
func (c *Container) GetContainerStats(previousStats *define.ContainerStats) (*define.ContainerStats, error) {
|
|
||||||
return nil, define.ErrOSNotSupported
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
)
|
|
||||||
|
|
||||||
func systemdSliceFromPath(parent, name string) (string, error) {
|
|
||||||
return "", errors.Wrapf(define.ErrOSNotSupported, "cgroups are not supported on non-linux OSes")
|
|
||||||
}
|
|
||||||
|
|
||||||
func makeSystemdCgroup(path string) error {
|
|
||||||
return errors.Wrapf(define.ErrOSNotSupported, "cgroups are not supported on non-linux OSes")
|
|
||||||
}
|
|
||||||
|
|
||||||
func deleteSystemdCgroup(path string) error {
|
|
||||||
return errors.Wrapf(define.ErrOSNotSupported, "cgroups are not supported on non-linux OSes")
|
|
||||||
}
|
|
||||||
|
|
||||||
func assembleSystemdCgroupName(baseSlice, newSlice string) (string, error) {
|
|
||||||
return "", errors.Wrapf(define.ErrOSNotSupported, "cgroups are not supported on non-linux OSes")
|
|
||||||
}
|
|
||||||
|
|
||||||
// LabelVolumePath takes a mount path for a volume and gives it an
|
|
||||||
// selinux label of either shared or not
|
|
||||||
func LabelVolumePath(path string) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func Unmount(mount string) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
// +build !linux
|
|
||||||
|
|
||||||
package libpod
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/containers/podman/v3/libpod/define"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (v *Volume) mount() error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v *Volume) unmount(force bool) error {
|
|
||||||
return define.ErrNotImplemented
|
|
||||||
}
|
|
Reference in New Issue
Block a user