webhook

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PodResource           = metav1.GroupVersionResource{Version: "v1", Resource: "pods"}
	MutateWebhooks        []MutateAdmissionWebhook
	UniversalDeserializer = serializer.NewCodecFactory(runtime.NewScheme()).UniversalDeserializer()
)

Functions

func AddToMutateHooks

func AddToMutateHooks(hook MutateAdmissionWebhook)

Types

type AdmissionWebhook

type AdmissionWebhook interface {
	ResourceNeedHandle(admission.AdmissionReview) (bool, error)
	Name() string
	Init(ServerOption)
}

type MutateAdmissionWebhook

type MutateAdmissionWebhook interface {
	AdmissionWebhook

	// Mutate resources
	Mutate(admission.AdmissionReview) ([]PatchOperation, error)
}

type PatchOperation

type PatchOperation struct {
	Operation string      `json:"op"`
	Path      string      `json:"path"`
	Value     interface{} `json:"value,omitempty"`
}

PatchOperation used for mutate webhook

type ServerOption

type ServerOption struct {
	SchedulerName string `json:"scheduler_name"`
	CertDir       string `json:"cert_dir"`
	TLSCert       string `json:"tls_cert"`
	TLSKey        string `json:"tls_key"`
}

func NewServerOption

func NewServerOption() *ServerOption

func (*ServerOption) AddFlags

func (s *ServerOption) AddFlags(fs *pflag.FlagSet) *pflag.FlagSet

type ValidateAdmissionWebhook

type ValidateAdmissionWebhook interface {
	AdmissionWebhook

	Validate() interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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