Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct { OsCommandRunner OsCommandRunner MetadataProvider metadata.Provider }
Environment struct for dependency injection.
func (Env) PrepareVolumesAndGetBindings ¶
func (env Env) PrepareVolumesAndGetBindings(spec api.ContainerSpecStruct) (map[string][]HostPathBindConfiguration, error)
PrepareVolumesAndGetBindings does 3 things:
- Verifies if the container specification passed to it is correct in terms of volumes it references.
- Creates/mounts/formats all the necessary volumes.
- Outputs the binding map, which will be used by the container runtime to bind the volumes containers.
The function takes a container specification struct. It operates in context of its environment (the receiver), which consist of two parts:
- OsCommandRunner: it executes the commands issued during execution of the function.
- MetadataProvider: it is the source of additional information coming from the metadata, used in processing persistent disks.
The function returns a map, its keys are container names (currently this should be a single name) and values are slices of hostPath binds. These corresponds to files and directories that are mounted in a container. Currently all supported types of volumes (EmptyDir, HostPath and PersistentDisk) are ultimately handled using a Docker's hostPath bind.
The caller should not expect the function to be idempotent. Errors are to be considered non-retryable.
func (Env) UnmountExistingVolumes ¶
UnmountExistingVolumes unmounts all volumes mounted under the directory managed by konlet. The function continues even if some unmounting operations fail and reports errors, if any, at the end.
type OsCommandRunner ¶
type VolumeHostPathAndMode ¶
type VolumeHostPathAndMode struct {
// contains filtered or unexported fields
}