package oci
import "github.com/Microsoft/hcsshim/internal/oci"
Index ¶
- Variables
- func IsIsolated(s *specs.Spec) bool
- func IsJobContainer(s *specs.Spec) bool
- func IsLCOW(s *specs.Spec) bool
- func IsWCOW(s *specs.Spec) bool
- func ParseAnnotationCommaSeparated(annotation string, annotations map[string]string) []string
- func ParseAnnotationsBool(ctx context.Context, a map[string]string, key string, def bool) bool
- func ParseAnnotationsCPUCount(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
- func ParseAnnotationsCPULimit(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
- func ParseAnnotationsCPUWeight(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
- func ParseAnnotationsDisableGMSA(ctx context.Context, s *specs.Spec) bool
- func ParseAnnotationsMemory(ctx context.Context, s *specs.Spec, annotation string, def uint64) uint64
- func ParseAnnotationsStorageBps(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
- func ParseAnnotationsStorageIops(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
- func ProcessAnnotations(ctx context.Context, s *specs.Spec) (err error)
- func SandboxAnnotationsPassThrough(podAnnots, containerAnnots map[string]string, vals ...string)
- func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) (interface{}, error)
- func UpdateSpecFromOptions(s specs.Spec, opts *runhcsopts.Options) specs.Spec
- type KubernetesContainerType
Variables ¶
Functions ¶
func IsIsolated ¶
func IsIsolated(s *specs.Spec) bool
IsIsolated checks if `s` is hypervisor isolated.
func IsJobContainer ¶
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 ¶
ParseAnnotationCommaSeparated searches `annotations` for `annotation` corresponding to a list of comma separated strings
func ParseAnnotationsBool ¶
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 ParseAnnotationsCPUCount ¶
func ParseAnnotationsCPUCount(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
ParseAnnotationsCPUCount searches `s.Annotations` for the CPU annotation. If not found searches `s` for the Windows CPU section. If neither are found returns `def`.
func ParseAnnotationsCPULimit ¶
func ParseAnnotationsCPULimit(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
ParseAnnotationsCPULimit searches `s.Annotations` for the CPU annotation. If not found searches `s` for the Windows CPU section. If neither are found returns `def`.
func ParseAnnotationsCPUWeight ¶
func ParseAnnotationsCPUWeight(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
ParseAnnotationsCPUWeight searches `s.Annotations` for the CPU annotation. If not found searches `s` for the Windows CPU section. If neither are found returns `def`.
func ParseAnnotationsDisableGMSA ¶
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 ParseAnnotationsMemory ¶
func ParseAnnotationsMemory(ctx context.Context, s *specs.Spec, annotation string, def uint64) uint64
ParseAnnotationsMemory searches `s.Annotations` for the memory annotation. If not found searches `s` for the Windows memory section. If neither are found returns `def`.
Note: The returned value is in `MB`.
func ParseAnnotationsStorageBps ¶
func ParseAnnotationsStorageBps(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
ParseAnnotationsStorageBps searches `s.Annotations` for the `Bps` annotation. If not found searches `s` for the Windows Storage section. If neither are found returns `def`.
func ParseAnnotationsStorageIops ¶
func ParseAnnotationsStorageIops(ctx context.Context, s *specs.Spec, annotation string, def int32) int32
ParseAnnotationsStorageIops searches `s.Annotations` for the `Iops` annotation. If not found searches `s` for the Windows Storage section. If neither are found returns `def`.
func ProcessAnnotations ¶
ProcessAnnotations expands annotations into their corresponding annotation groups
func SandboxAnnotationsPassThrough ¶
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.
func SpecToUVMCreateOpts ¶
SpecToUVMCreateOpts parses `s` and returns either `*uvm.OptionsLCOW` or `*uvm.OptionsWCOW`.
func UpdateSpecFromOptions ¶
func UpdateSpecFromOptions(s specs.Spec, opts *runhcsopts.Options) specs.Spec
UpdateSpecFromOptions sets extra annotations on the OCI spec based on the `opts` struct.
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.
Source Files ¶
annotations.go sandbox.go util.go uvm.go
- Version
- v0.11.8
- Published
- Nov 6, 2024
- Platform
- windows/amd64
- Imports
- 12 packages
- Last checked
- 12 minutes ago –
Tools for package owners.