ociannotations

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedContainerRuntime = errors.New("unsupported container runtime")

ErrUnsupportedContainerRuntime is used for unsupported container runtime

Functions

This section is empty.

Types

type Resolver

type Resolver interface {
	// ContainerName returns the name of the container in a pod
	ContainerName(annotations map[string]string) string
	// ContainerType returns the type of the container i.e "container" or "sandbox"
	ContainerType(annotations map[string]string) string
	// PodName returns the name of the pod to which the container belongs
	PodName(annotations map[string]string) string
	// PodUID returns the uid of pod to which the container belongs
	PodUID(annotations map[string]string) string
	// PodNamespace returns the namespace of the pod to which container belongs
	PodNamespace(annotations map[string]string) string
	// Runtime returns runtime in which the container is running
	Runtime() string
}

Resolver is used to resolve attributes for a container by using container runtime annotations

func NewResolver

func NewResolver(runtime string) (Resolver, error)

NewResolver creates a Resolver for a given container runtime

func NewResolverFromAnnotations

func NewResolverFromAnnotations(annotations map[string]string) (Resolver, error)

NewResolverFromAnnotations creates a Resolver by detecting runtime from annotations

Jump to

Keyboard shortcuts

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