github.com/AbhinandanKurakure/podman/v3@v3.4.10/libpod/define/errors.go (about)

     1  package define
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  )
     7  
     8  var (
     9  	// ErrNoSuchCtr indicates the requested container does not exist
    10  	ErrNoSuchCtr = errors.New("no such container")
    11  
    12  	// ErrNoSuchPod indicates the requested pod does not exist
    13  	ErrNoSuchPod = errors.New("no such pod")
    14  
    15  	// ErrNoSuchVolume indicates the requested volume does not exist
    16  	ErrNoSuchVolume = errors.New("no such volume")
    17  
    18  	// ErrNoSuchNetwork indicates the requested network does not exist
    19  	ErrNoSuchNetwork = errors.New("network not found")
    20  
    21  	// ErrNoSuchExecSession indicates that the requested exec session does
    22  	// not exist.
    23  	ErrNoSuchExecSession = errors.New("no such exec session")
    24  
    25  	// ErrDepExists indicates that the current object has dependencies and
    26  	// cannot be removed before them.
    27  	ErrDepExists = errors.New("dependency exists")
    28  
    29  	// ErrNoAliases indicates that the container does not have any network
    30  	// aliases.
    31  	ErrNoAliases = errors.New("no aliases for container")
    32  
    33  	// ErrMissingPlugin indicates that the requested operation requires a
    34  	// plugin that is not present on the system or in the configuration.
    35  	ErrMissingPlugin = errors.New("required plugin missing")
    36  
    37  	// ErrCtrExists indicates a container with the same name or ID already
    38  	// exists
    39  	ErrCtrExists = errors.New("container already exists")
    40  	// ErrPodExists indicates a pod with the same name or ID already exists
    41  	ErrPodExists = errors.New("pod already exists")
    42  	// ErrImageExists indicates an image with the same ID already exists
    43  	ErrImageExists = errors.New("image already exists")
    44  	// ErrVolumeExists indicates a volume with the same name already exists
    45  	ErrVolumeExists = errors.New("volume already exists")
    46  	// ErrExecSessionExists indicates an exec session with the same ID
    47  	// already exists.
    48  	ErrExecSessionExists = errors.New("exec session already exists")
    49  	// ErrNetworkExists indicates that a network with the given name already
    50  	// exists.
    51  	ErrNetworkExists = errors.New("network already exists")
    52  
    53  	// ErrCtrStateInvalid indicates a container is in an improper state for
    54  	// the requested operation
    55  	ErrCtrStateInvalid = errors.New("container state improper")
    56  	// ErrExecSessionStateInvalid indicates that an exec session is in an
    57  	// improper state for the requested operation
    58  	ErrExecSessionStateInvalid = errors.New("exec session state improper")
    59  	// ErrVolumeBeingUsed indicates that a volume is being used by at least one container
    60  	ErrVolumeBeingUsed = errors.New("volume is being used")
    61  
    62  	// ErrRuntimeFinalized indicates that the runtime has already been
    63  	// created and cannot be modified
    64  	ErrRuntimeFinalized = errors.New("runtime has been finalized")
    65  	// ErrCtrFinalized indicates that the container has already been created
    66  	// and cannot be modified
    67  	ErrCtrFinalized = errors.New("container has been finalized")
    68  	// ErrPodFinalized indicates that the pod has already been created and
    69  	// cannot be modified
    70  	ErrPodFinalized = errors.New("pod has been finalized")
    71  	// ErrVolumeFinalized indicates that the volume has already been created and
    72  	// cannot be modified
    73  	ErrVolumeFinalized = errors.New("volume has been finalized")
    74  
    75  	// ErrInvalidArg indicates that an invalid argument was passed
    76  	ErrInvalidArg = errors.New("invalid argument")
    77  	// ErrEmptyID indicates that an empty ID was passed
    78  	ErrEmptyID = errors.New("name or ID cannot be empty")
    79  
    80  	// ErrInternal indicates an internal library error
    81  	ErrInternal = errors.New("internal libpod error")
    82  
    83  	// ErrPodPartialFail indicates that a pod operation was only partially
    84  	// successful, and some containers within the pod failed.
    85  	ErrPodPartialFail = errors.New("some containers failed")
    86  
    87  	// ErrDetach indicates that an attach session was manually detached by
    88  	// the user.
    89  	ErrDetach = errors.New("detached from container")
    90  
    91  	// ErrWillDeadlock indicates that the requested operation will cause a
    92  	// deadlock. This is usually caused by upgrade issues, and is resolved
    93  	// by renumbering the locks.
    94  	ErrWillDeadlock = errors.New("deadlock due to lock mismatch")
    95  
    96  	// ErrNoCgroups indicates that the container does not have its own
    97  	// CGroup.
    98  	ErrNoCgroups = errors.New("this container does not have a cgroup")
    99  	// ErrNoLogs indicates that this container is not creating a log so log
   100  	// operations cannot be performed on it
   101  	ErrNoLogs = errors.New("this container is not logging output")
   102  
   103  	// ErrRootless indicates that the given command cannot but run without
   104  	// root.
   105  	ErrRootless = errors.New("operation requires root privileges")
   106  
   107  	// ErrRuntimeStopped indicates that the runtime has already been shut
   108  	// down and no further operations can be performed on it
   109  	ErrRuntimeStopped = errors.New("runtime has already been stopped")
   110  	// ErrCtrStopped indicates that the requested container is not running
   111  	// and the requested operation cannot be performed until it is started
   112  	ErrCtrStopped = errors.New("container is stopped")
   113  
   114  	// ErrCtrRemoved indicates that the container has already been removed
   115  	// and no further operations can be performed on it
   116  	ErrCtrRemoved = errors.New("container has already been removed")
   117  	// ErrPodRemoved indicates that the pod has already been removed and no
   118  	// further operations can be performed on it
   119  	ErrPodRemoved = errors.New("pod has already been removed")
   120  	// ErrVolumeRemoved indicates that the volume has already been removed and
   121  	// no further operations can be performed on it
   122  	ErrVolumeRemoved = errors.New("volume has already been removed")
   123  	// ErrExecSessionRemoved indicates that the exec session has already
   124  	// been removed and no further operations can be performed on it.
   125  	ErrExecSessionRemoved = errors.New("exec session has already been removed")
   126  
   127  	// ErrDBClosed indicates that the connection to the state database has
   128  	// already been closed
   129  	ErrDBClosed = errors.New("database connection already closed")
   130  	// ErrDBBadConfig indicates that the database has a different schema or
   131  	// was created by a libpod with a different config
   132  	ErrDBBadConfig = errors.New("database configuration mismatch")
   133  
   134  	// ErrNSMismatch indicates that the requested pod or container is in a
   135  	// different namespace and cannot be accessed or modified.
   136  	ErrNSMismatch = errors.New("target is in a different namespace")
   137  
   138  	// ErrNotImplemented indicates that the requested functionality is not
   139  	// yet present
   140  	ErrNotImplemented = errors.New("not yet implemented")
   141  
   142  	// ErrOSNotSupported indicates the function is not available on the particular
   143  	// OS.
   144  	ErrOSNotSupported = errors.New("no support for this OS yet")
   145  
   146  	// ErrOCIRuntime indicates a generic error from the OCI runtime
   147  	ErrOCIRuntime = errors.New("OCI runtime error")
   148  
   149  	// ErrOCIRuntimePermissionDenied indicates the OCI runtime attempted to invoke a command that returned
   150  	// a permission denied error
   151  	ErrOCIRuntimePermissionDenied = errors.New("OCI permission denied")
   152  
   153  	// ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command
   154  	// that was not found
   155  	ErrOCIRuntimeNotFound = errors.New("OCI runtime attempted to invoke a command that was not found")
   156  
   157  	// ErrOCIRuntimeUnavailable indicates that the OCI runtime associated to a container
   158  	// could not be found in the configuration
   159  	ErrOCIRuntimeUnavailable = errors.New("OCI unavailable")
   160  
   161  	// ErrConmonOutdated indicates the version of conmon found (whether via the configuration or $PATH)
   162  	// is out of date for the current podman version
   163  	ErrConmonOutdated = errors.New("outdated conmon version")
   164  	// ErrConmonDead indicates that the container's conmon process has been
   165  	// killed, preventing normal operation.
   166  	ErrConmonDead = errors.New("conmon process killed")
   167  
   168  	// ErrNetworkOnPodContainer indicates the user wishes to alter network attributes on a container
   169  	// in a pod.  This cannot be done as the infra container has all the network information
   170  	ErrNetworkOnPodContainer = errors.New("network cannot be configured when it is shared with a pod")
   171  
   172  	// ErrNetworkInUse indicates the requested operation failed because the network was in use
   173  	ErrNetworkInUse = errors.New("network is being used")
   174  
   175  	// ErrStoreNotInitialized indicates that the container storage was never
   176  	// initialized.
   177  	ErrStoreNotInitialized = errors.New("the container storage was never initialized")
   178  
   179  	// ErrNoNetwork indicates that a container has no net namespace, like network=none
   180  	ErrNoNetwork = errors.New("container has no network namespace")
   181  
   182  	// ErrNetworkModeInvalid indicates that a container has the wrong network mode for an operation
   183  	ErrNetworkModeInvalid = errors.New("invalid network mode")
   184  
   185  	// ErrSetSecurityAttribute indicates that a request to set a container's security attribute
   186  	// was not possible.
   187  	ErrSetSecurityAttribute = fmt.Errorf("%w: unable to assign security attribute", ErrOCIRuntime)
   188  
   189  	// ErrGetSecurityAttribute indicates that a request to get a container's security attribute
   190  	// was not possible.
   191  	ErrGetSecurityAttribute = fmt.Errorf("%w: unable to get security attribute", ErrOCIRuntime)
   192  
   193  	// ErrSecurityAttribute indicates that an error processing security attributes
   194  	// for the container
   195  	ErrSecurityAttribute = fmt.Errorf("%w: unable to process security attribute", ErrOCIRuntime)
   196  
   197  	// ErrCanceled indicates that an operation has been cancelled by a user.
   198  	// Useful for potentially long running tasks.
   199  	ErrCanceled = errors.New("cancelled by user")
   200  
   201  	// ErrConmonVersionFormat is used when the expected versio-format of conmon
   202  	// has changed.
   203  	ErrConmonVersionFormat = "conmon version changed format"
   204  )