Documentation ¶
Overview ¶
Package utils container miscellaneous utility function used by the shim.
Index ¶
Constants ¶
const ( // ContainerTypeAnnotation is they key that defines sandbox or container. ContainerTypeAnnotation = "io.kubernetes.cri.container-type" // ContainerTypeContainer is the value for container. ContainerTypeContainer = "container" )
Annotations from the CRI annotations package.
These are vendor due to import conflicts.
Variables ¶
This section is empty.
Functions ¶
func PanicLogPath ¶
PanicLogPath gets the panic log path from OCI annotation.
func UpdateVolumeAnnotations ¶
UpdateVolumeAnnotations add necessary OCI annotations for gvisor volume optimization. Returns true if the spec was modified.
Note about EmptyDir handling: The admission controller sets mount annotations for EmptyDir as follows: - For EmptyDir volumes with medium=Memory, the "type" field is set to tmpfs. - For EmptyDir volumes with medium="", the "type" field is set to bind.
The container spec has EmptyDir mount points as bind mounts. This method modifies the spec as follows: - The "type" mount annotation for all EmptyDirs is changed to tmpfs. - The mount type in spec.Mounts[i].Type is changed as follows:
- For EmptyDir volumes with medium=Memory, we change it to tmpfs.
- For EmptyDir volumes with medium="", we leave it as a bind mount.
- (Essentially we set it to what the admission controller said.)
runsc should use these two setting to infer EmptyDir medium:
- tmpfs annotation type + tmpfs mount type = memory-backed EmptyDir
- tmpfs annotation type + bind mount type = disk-backed EmptyDir
func UserLogPath ¶
UserLogPath gets user log path from OCI annotation.
Types ¶
This section is empty.