arch

package
v0.0.0-...-00ec399 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainerImages

func GetContainerImages(containerLists ...[]v1.Container) []string

func GetImagePullSecretFromPodSpec

func GetImagePullSecretFromPodSpec(ctx context.Context, k8sClient client.Client, namespace string, podSpec *v1.PodSpec) (string, error)

func ParseMatchNodeLabels

func ParseMatchNodeLabels(labels string) []string

func PodSpecHasNodeArchitectureSelection

func PodSpecHasNodeArchitectureSelection(ctx context.Context, podSpec *v1.PodSpec) (string, bool)

Types

type Handler

type Handler struct {
	Client   client.Client
	Registry Registry
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(client client.Client, registry Registry, opts ...HandlerOption) *Handler

func (*Handler) Handle

func (*Handler) InjectDecoder

func (a *Handler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

type HandlerMetrics

type HandlerMetrics struct {
	ImagePullSecretFailed             *prometheus.CounterVec
	RegistryErrors                    *prometheus.CounterVec
	UpdateSkept                       *prometheus.CounterVec
	ArchSelectorInjected              *prometheus.CounterVec
	PreferredArchitectureNotAvailable *prometheus.CounterVec
	NodeMatchSelector                 *prometheus.CounterVec
}

func NewHandlerMetrics

func NewHandlerMetrics(prefix string) *HandlerMetrics

func (HandlerMetrics) MustRegister

func (m HandlerMetrics) MustRegister(reg metrics.RegistererGatherer)

type HandlerOption

type HandlerOption func(*Handler)

func WithArchitecture

func WithArchitecture(arch string) HandlerOption

func WithDecoder

func WithDecoder(decoder *admission.Decoder) HandlerOption

func WithMatchNodeLabels

func WithMatchNodeLabels(labels []string) HandlerOption

func WithMetricsRegistry

func WithMetricsRegistry(reg metrics.RegistererGatherer) HandlerOption

func WithOS

func WithOS(os string) HandlerOption

func WithSchedulableArchitectures

func WithSchedulableArchitectures(archs []string) HandlerOption

type Registry

type Registry interface {
	ListArchs(ctx context.Context, imagePullSecret, image string) ([]registry.Platform, error)
}

type RegistryFunc

type RegistryFunc func(ctx context.Context, imagePullSecret, image string) ([]registry.Platform, error)

func (RegistryFunc) ListArchs

func (f RegistryFunc) ListArchs(ctx context.Context, imagePullSecret, image string) ([]registry.Platform, error)

Jump to

Keyboard shortcuts

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