github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/libpod/define/errors.go (about)

     1  package define
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/containers/libpod/libpod/image"
     7  	"github.com/containers/libpod/utils"
     8  )
     9  
    10  var (
    11  	// ErrNoSuchCtr indicates the requested container does not exist
    12  	ErrNoSuchCtr = image.ErrNoSuchCtr
    13  
    14  	// ErrNoSuchPod indicates the requested pod does not exist
    15  	ErrNoSuchPod = image.ErrNoSuchPod
    16  
    17  	// ErrNoSuchImage indicates the requested image does not exist
    18  	ErrNoSuchImage = image.ErrNoSuchImage
    19  
    20  	// ErrNoSuchVolume indicates the requested volume does not exist
    21  	ErrNoSuchVolume = errors.New("no such volume")
    22  
    23  	// ErrNoSuchExecSession indicates that the requested exec session does
    24  	// not exist.
    25  	ErrNoSuchExecSession = errors.New("no such exec session")
    26  
    27  	// ErrCtrExists indicates a container with the same name or ID already
    28  	// exists
    29  	ErrCtrExists = errors.New("container already exists")
    30  	// ErrPodExists indicates a pod with the same name or ID already exists
    31  	ErrPodExists = errors.New("pod already exists")
    32  	// ErrImageExists indicates an image with the same ID already exists
    33  	ErrImageExists = errors.New("image already exists")
    34  	// ErrVolumeExists indicates a volume with the same name already exists
    35  	ErrVolumeExists = errors.New("volume already exists")
    36  	// ErrExecSessionExists indicates an exec session with the same ID
    37  	// already exists.
    38  	ErrExecSessionExists = errors.New("exec session already exists")
    39  
    40  	// ErrCtrStateInvalid indicates a container is in an improper state for
    41  	// the requested operation
    42  	ErrCtrStateInvalid = errors.New("container state improper")
    43  	// ErrExecSessionStateInvalid indicates that an exec session is in an
    44  	// improper state for the requested operation
    45  	ErrExecSessionStateInvalid = errors.New("exec session state improper")
    46  	// ErrVolumeBeingUsed indicates that a volume is being used by at least one container
    47  	ErrVolumeBeingUsed = errors.New("volume is being used")
    48  
    49  	// ErrRuntimeFinalized indicates that the runtime has already been
    50  	// created and cannot be modified
    51  	ErrRuntimeFinalized = errors.New("runtime has been finalized")
    52  	// ErrCtrFinalized indicates that the container has already been created
    53  	// and cannot be modified
    54  	ErrCtrFinalized = errors.New("container has been finalized")
    55  	// ErrPodFinalized indicates that the pod has already been created and
    56  	// cannot be modified
    57  	ErrPodFinalized = errors.New("pod has been finalized")
    58  	// ErrVolumeFinalized indicates that the volume has already been created and
    59  	// cannot be modified
    60  	ErrVolumeFinalized = errors.New("volume has been finalized")
    61  
    62  	// ErrInvalidArg indicates that an invalid argument was passed
    63  	ErrInvalidArg = errors.New("invalid argument")
    64  	// ErrEmptyID indicates that an empty ID was passed
    65  	ErrEmptyID = errors.New("name or ID cannot be empty")
    66  
    67  	// ErrInternal indicates an internal library error
    68  	ErrInternal = errors.New("internal libpod error")
    69  
    70  	// ErrDetach indicates that an attach session was manually detached by
    71  	// the user.
    72  	ErrDetach = utils.ErrDetach
    73  
    74  	// ErrWillDeadlock indicates that the requested operation will cause a
    75  	// deadlock. This is usually caused by upgrade issues, and is resolved
    76  	// by renumbering the locks.
    77  	ErrWillDeadlock = errors.New("deadlock due to lock mismatch")
    78  
    79  	// ErrNoCgroups indicates that the container does not have its own
    80  	// CGroup.
    81  	ErrNoCgroups = errors.New("this container does not have a cgroup")
    82  
    83  	// ErrRootless indicates that the given command cannot but run without
    84  	// root.
    85  	ErrRootless = errors.New("operation requires root privileges")
    86  
    87  	// ErrRuntimeStopped indicates that the runtime has already been shut
    88  	// down and no further operations can be performed on it
    89  	ErrRuntimeStopped = errors.New("runtime has already been stopped")
    90  	// ErrCtrStopped indicates that the requested container is not running
    91  	// and the requested operation cannot be performed until it is started
    92  	ErrCtrStopped = errors.New("container is stopped")
    93  
    94  	// ErrCtrRemoved indicates that the container has already been removed
    95  	// and no further operations can be performed on it
    96  	ErrCtrRemoved = errors.New("container has already been removed")
    97  	// ErrPodRemoved indicates that the pod has already been removed and no
    98  	// further operations can be performed on it
    99  	ErrPodRemoved = errors.New("pod has already been removed")
   100  	// ErrVolumeRemoved indicates that the volume has already been removed and
   101  	// no further operations can be performed on it
   102  	ErrVolumeRemoved = errors.New("volume has already been removed")
   103  	// ErrExecSessionRemoved indicates that the exec session has already
   104  	// been removed and no further operations can be performed on it.
   105  	ErrExecSessionRemoved = errors.New("exec session has already been removed")
   106  
   107  	// ErrDBClosed indicates that the connection to the state database has
   108  	// already been closed
   109  	ErrDBClosed = errors.New("database connection already closed")
   110  	// ErrDBBadConfig indicates that the database has a different schema or
   111  	// was created by a libpod with a different config
   112  	ErrDBBadConfig = errors.New("database configuration mismatch")
   113  
   114  	// ErrNSMismatch indicates that the requested pod or container is in a
   115  	// different namespace and cannot be accessed or modified.
   116  	ErrNSMismatch = errors.New("target is in a different namespace")
   117  
   118  	// ErrNotImplemented indicates that the requested functionality is not
   119  	// yet present
   120  	ErrNotImplemented = errors.New("not yet implemented")
   121  
   122  	// ErrOSNotSupported indicates the function is not available on the particular
   123  	// OS.
   124  	ErrOSNotSupported = errors.New("no support for this OS yet")
   125  
   126  	// ErrOCIRuntime indicates a generic error from the OCI runtime
   127  	ErrOCIRuntime = errors.New("OCI runtime error")
   128  
   129  	// ErrOCIRuntimePermissionDenied indicates the OCI runtime attempted to invoke a command that returned
   130  	// a permission denied error
   131  	ErrOCIRuntimePermissionDenied = errors.New("OCI runtime permission denied error")
   132  
   133  	// ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command
   134  	// that was not found
   135  	ErrOCIRuntimeNotFound = errors.New("OCI runtime command not found error")
   136  
   137  	// ErrOCIRuntimeUnavailable indicates that the OCI runtime associated to a container
   138  	// could not be found in the configuration
   139  	ErrOCIRuntimeUnavailable = errors.New("OCI runtime not available in the current configuration")
   140  
   141  	// ErrConmonOutdated indicates the version of conmon found (whether via the configuration or $PATH)
   142  	// is out of date for the current podman version
   143  	ErrConmonOutdated = errors.New("outdated conmon version")
   144  )