webhook

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImageSwapper

func NewImageSwapper(registryClient registry.Client, imagePullSecretProvider secrets.ImagePullSecretsProvider, filters []config.JMESPathFilter, imageSwapPolicy types.ImageSwapPolicy, imageCopyPolicy types.ImageCopyPolicy) kwhmutating.Mutator

NewImageSwapper returns a new ImageSwapper initialized.

func NewImageSwapperWebhook

func NewImageSwapperWebhook(registryClient registry.Client, imagePullSecretProvider secrets.ImagePullSecretsProvider, filters []config.JMESPathFilter, imageSwapPolicy types.ImageSwapPolicy, imageCopyPolicy types.ImageCopyPolicy) (webhook.Webhook, error)

func NewImageSwapperWebhookWithOpts

func NewImageSwapperWebhookWithOpts(registryClient registry.Client, opts ...Option) (webhook.Webhook, error)

func NewImageSwapperWithOpts

func NewImageSwapperWithOpts(registryClient registry.Client, opts ...Option) kwhmutating.Mutator

NewImageSwapperWithOpts returns a configured ImageSwapper instance

Types

type FilterContext

type FilterContext struct {
	// Obj contains the object submitted to the webhook (currently only pods)
	Obj metav1.Object `json:"obj,omitempty"`

	// Container contains the currently processed container
	Container corev1.Container `json:"container,omitempty"`
}

FilterContext is being used by JMESPath to search and match

func NewFilterContext

func NewFilterContext(request kwhmodel.AdmissionReview, obj metav1.Object, container corev1.Container) FilterContext

type ImageSwapper

type ImageSwapper struct {
	// contains filtered or unexported fields
}

ImageSwapper is a mutator that will download images and change the image name.

func (*ImageSwapper) Mutate

Mutate replaces the image ref. Satisfies mutating.Mutator interface.

type Option

type Option func(*ImageSwapper)

Option represents an option that can be passed when instantiating the image swapper to customize it

func Copier

func Copier(pool *pond.WorkerPool) Option

Copier allows to pass the copier option

func Filters

func Filters(filters []config.JMESPathFilter) Option

Filters allows to pass JMESPathFilter to select the images to be swapped

func ImageCopyPolicy

func ImageCopyPolicy(policy types.ImageCopyPolicy) Option

ImageCopyPolicy allows to pass the ImageCopyPolicy option

func ImagePullSecretsProvider

func ImagePullSecretsProvider(provider secrets.ImagePullSecretsProvider) Option

ImagePullSecretsProvider allows to pass a provider reading out Kubernetes secrets

func ImageSwapPolicy

func ImageSwapPolicy(policy types.ImageSwapPolicy) Option

ImageSwapPolicy allows to pass the ImageSwapPolicy option

Jump to

Keyboard shortcuts

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