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