Documentation ¶
Overview ¶
Package utils container miscellaneous utility function used by the shim.
Index ¶
- Constants
- func ErrToGRPC(err error) error
- func ErrToGRPCf(err error, format string, args ...interface{}) error
- func IsSandbox(spec *specs.Spec) bool
- func ReadSpec(bundle string) (*specs.Spec, error)
- func UpdateVolumeAnnotations(s *specs.Spec) (bool, error)
- func UserLogPath(spec *specs.Spec) string
- func WriteSpec(bundle string, spec *specs.Spec) error
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 ErrToGRPC ¶
ErrToGRPC wraps containerd's ToGRPC error mapper which depends on github.com/pkg/errors to work correctly. Once we upgrade to containerd v1.4, this function can go away and we can use errdefs.ToGRPC directly instead.
TODO(gvisor.dev/issue/6232): Remove after upgrading to containerd v1.4
func ErrToGRPCf ¶
ErrToGRPCf maps the error to grpc error codes, assembling the formatting string and combining it with the target error string.
TODO(gvisor.dev/issue/6232): Remove after upgrading to containerd v1.4
func UpdateVolumeAnnotations ¶
UpdateVolumeAnnotations add necessary OCI annotations for gvisor volume optimization. Returns true if the spec was modified.
func UserLogPath ¶
UserLogPath gets user log path from OCI annotation.
Types ¶
This section is empty.