oci

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAnnotationExpansionConflict = errors.New("annotation expansion conflict")

Functions

func IsIsolated

func IsIsolated(s *specs.Spec) bool

IsIsolated checks if `s` is hypervisor isolated.

func IsJobContainer added in v0.9.0

func IsJobContainer(s *specs.Spec) bool

IsJobContainer checks if `s` is asking for a Windows job container.

func IsLCOW

func IsLCOW(s *specs.Spec) bool

IsLCOW checks if `s` is a LCOW config.

func IsWCOW

func IsWCOW(s *specs.Spec) bool

IsWCOW checks if `s` is a WCOW config (argon OR isolated).

func ParseAnnotationCommaSeparated added in v0.9.0

func ParseAnnotationCommaSeparated(annotation string, annotations map[string]string) []string

ParseAnnotationCommaSeparated searches `annotations` for `annotation` corresponding to a list of comma separated strings

func ParseAnnotationCommaSeparatedUint32 added in v0.12.0

func ParseAnnotationCommaSeparatedUint32(ctx context.Context, annotations map[string]string, annotation string, def []uint32) []uint32

ParseAnnotationCommaSeparated searches `annotations` for `annotation` corresponding to a list of comma separated strings

func ParseAnnotationsBool added in v0.10.0

func ParseAnnotationsBool(ctx context.Context, a map[string]string, key string, def bool) bool

ParseAnnotationsBool searches `a` for `key` and if found verifies that the value is `true` or `false` in any case. If `key` is not found returns `def`.

func ParseAnnotationsDisableGMSA added in v0.10.0

func ParseAnnotationsDisableGMSA(ctx context.Context, s *specs.Spec) bool

ParseAnnotationsDisableGMSA searches for the boolean value which specifies if providing a gMSA credential should be disallowed. Returns the value found, if parsable, otherwise returns false otherwise.

func ParseAnnotationsInt32 added in v0.12.0

func ParseAnnotationsInt32(ctx context.Context, a map[string]string, key string, def int32) int32

ParseAnnotationsInt32 searches `a` for `key` and if found verifies that the value is a 32-bit signed integer. If `key` is not found returns `def`.

func ParseAnnotationsNullableBool added in v0.12.0

func ParseAnnotationsNullableBool(ctx context.Context, a map[string]string, key string) *bool

ParseAnnotationsNullableBool searches `a` for `key` and if found verifies that the value is `true` or `false`. If `key` is not found it returns a null pointer. The JSON Marshaller will omit null pointers and will serialize non-null pointers as the value they point at.

func ParseAnnotationsString added in v0.12.0

func ParseAnnotationsString(a map[string]string, key string, def string) string

ParseAnnotationsString searches `a` for `key`. If `key` is not found returns `def`.

func ParseAnnotationsUint32 added in v0.12.0

func ParseAnnotationsUint32(ctx context.Context, a map[string]string, key string, def uint32) uint32

ParseAnnotationsUint32 searches `a` for `key` and if found verifies that the value is a 32 bit unsigned integer. If `key` is not found returns `def`.

func ParseAnnotationsUint64 added in v0.12.0

func ParseAnnotationsUint64(ctx context.Context, a map[string]string, key string, def uint64) uint64

ParseAnnotationsUint64 searches `a` for `key` and if found verifies that the value is a 64 bit unsigned integer. If `key` is not found returns `def`.

func ProcessAnnotations added in v0.10.0

func ProcessAnnotations(ctx context.Context, s *specs.Spec) (err error)

ProcessAnnotations expands annotations into their corresponding annotation groups.

func SandboxAnnotationsPassThrough added in v0.10.0

func SandboxAnnotationsPassThrough(podAnnots, containerAnnots map[string]string, vals ...string)

SandboxAnnotationsPassThrough passes through the annotations specified by 'vals' from the sandboxes set of annotations through to every container in the pod. Kubernetes only passes metadata annotations to the RunPodSandbox request, so annotations that are meant to be available for use/checking for individual containers need some way to know they were passed for the pod.

Types

type KubernetesContainerType

type KubernetesContainerType string

KubernetesContainerType defines the valid types of the `annotations.KubernetesContainerType` annotation.

const (
	// KubernetesContainerTypeNone is only valid when
	// `annotations.KubernetesContainerType` is not set.
	KubernetesContainerTypeNone KubernetesContainerType = ""
	// KubernetesContainerTypeContainer is valid when
	// `annotations.KubernetesContainerType == "container"`.
	KubernetesContainerTypeContainer KubernetesContainerType = "container"
	// KubernetesContainerTypeSandbox is valid when
	// `annotations.KubernetesContainerType == "sandbox"`.
	KubernetesContainerTypeSandbox KubernetesContainerType = "sandbox"
)

func GetSandboxTypeAndID

func GetSandboxTypeAndID(specAnnotations map[string]string) (KubernetesContainerType, string, error)

GetSandboxTypeAndID parses `specAnnotations` searching for the `KubernetesContainerTypeAnnotation` and `KubernetesSandboxIDAnnotation` annotations and if found validates the set before returning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL