webhook

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URI                  string = "/mutate-pod"
	ReadinessEndpointURI string = "/readyz"
	HealthzEndpointURI   string = "/healthz"
	WebhookName          string = "das-webhook"
)

Variables

This section is empty.

Functions

func SendResponse

func SendResponse(w io.Writer, resp admissionctl.Response)

SendResponse Send the AdmissionReview.

Types

type Dispatcher

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

Dispatcher struct

func NewDispatcher

func NewDispatcher(hook Webhook) *Dispatcher

NewDispatcher new dispatcher

func (*Dispatcher) HandleHealthz

func (d *Dispatcher) HandleHealthz(w http.ResponseWriter, r *http.Request)

func (*Dispatcher) HandleReadiness

func (d *Dispatcher) HandleReadiness(w http.ResponseWriter, r *http.Request)

func (*Dispatcher) HandleRequest

func (d *Dispatcher) HandleRequest(w http.ResponseWriter, r *http.Request)

HandleRequest http request

type InstasliceWebhook

type InstasliceWebhook struct{}

func (*InstasliceWebhook) Authorized

Authorized implements Webhook interface

func (*InstasliceWebhook) GetHealthzURI

func (s *InstasliceWebhook) GetHealthzURI() string

GetHealthzURI() implements Webhook interface

func (*InstasliceWebhook) GetReadinessURI

func (s *InstasliceWebhook) GetReadinessURI() string

GetReadinessURI implements Webhook interface

func (*InstasliceWebhook) GetURI

func (s *InstasliceWebhook) GetURI() string

GetURI implements Webhook interface

func (*InstasliceWebhook) Name

func (s *InstasliceWebhook) Name() string

Name implements Webhook interface

func (*InstasliceWebhook) Validate

func (s *InstasliceWebhook) Validate(req admissionctl.Request) bool

Validate if the incoming request even valid

type Webhook

type Webhook interface {
	// Authorized will determine if the request is allowed
	Authorized(request admissionctl.Request) admissionctl.Response
	// GetURI returns the URI for the webhook
	GetURI() string
	// GetReadiness URI returns the URI for the webhook
	GetReadinessURI() string
	// GetHealthzURI() returns the URI for the webhook
	GetHealthzURI() string
	// Name is the name of the webhook
	Name() string
}

Webhook interface

func NewWebhook

func NewWebhook() Webhook

Jump to

Keyboard shortcuts

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