shadowpod

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package shadowpod contains the validating webhook logic and the cache of peering information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMutator

func NewMutator(c client.Client) *webhook.Admission

NewMutator creates a new shadow pod mutator.

Types

type Description

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

Description is a struct that contains the main informations about a shadow pod.

type Mutator

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

Mutator is the handler used by the Mutating Webhook to mutate shadow pods.

func (*Mutator) Handle

Handle is the function in charge of handling the webhook mutating request about the creation, update and deletion of shadowpods.

func (*Mutator) HandleCreate

func (spm *Mutator) HandleCreate(req *admission.Request) admission.Response

HandleCreate is the function in charge of handling Creation requests.

func (*Mutator) HandleDelete

func (spm *Mutator) HandleDelete() admission.Response

HandleDelete is the function in charge of handling Deletion requests.

func (*Mutator) HandleUpdate

func (spm *Mutator) HandleUpdate(req *admission.Request) admission.Response

HandleUpdate is the function in charge of handling Update requests.

type Validator

type Validator struct {
	PeeringCache *peeringCache
	// contains filtered or unexported fields
}

Validator is the handler used by the Validating Webhook to validate shadow pods.

func NewValidator

func NewValidator(c client.Client, enableResourceValidation bool) *Validator

NewValidator creates a new shadow pod validator.

func (*Validator) CacheRefresher

func (spv *Validator) CacheRefresher(interval time.Duration) func(ctx context.Context) error

CacheRefresher is a wrapper function that receives a ShadowPodValidator and starts a PollImmediateInfinite timer to periodically refresh the cache.

func (*Validator) Handle

Handle is the function in charge of handling the webhook validation request about the creation, update and deletion of shadowpods.

func (*Validator) HandleCreate

func (spv *Validator) HandleCreate(ctx context.Context, req *admission.Request) admission.Response

HandleCreate is the function in charge of handling Creation requests.

func (*Validator) HandleDelete

func (spv *Validator) HandleDelete(ctx context.Context, req *admission.Request) admission.Response

HandleDelete is the function in charge of handling Deletion requests.

func (*Validator) HandleUpdate

func (spv *Validator) HandleUpdate(ctx context.Context, req *admission.Request) admission.Response

HandleUpdate is the function in charge of handling Update requests.

Jump to

Keyboard shortcuts

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