webhook

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImageSwapper

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

NewImageSwapper returns a new ImageSwapper initialized.

func NewImageSwapperWebhook

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

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 v1beta1.AdmissionRequest, 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

func (p *ImageSwapper) Mutate(ctx context.Context, obj metav1.Object) (bool, error)

Mutate will set the required labels on the pods. Satisfies mutating.Mutator interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL