handlers

package
v1.13.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpError added in v1.9.0

func HttpError(ctx context.Context, writer http.ResponseWriter, request *http.Request, logger logr.Logger, err error, code int)

func Probe

func Probe(check func(context.Context) bool) http.HandlerFunc

Types

type AdmissionHandler

func FromAdmissionFunc added in v1.9.0

func FromAdmissionFunc(name string, h AdmissionHandler) AdmissionHandler

func (AdmissionHandler) WithAdmission added in v1.8.2

func (inner AdmissionHandler) WithAdmission(logger logr.Logger) HttpHandler

func (AdmissionHandler) WithDump added in v1.9.0

func (inner AdmissionHandler) WithDump(
	enabled bool,
) AdmissionHandler

func (AdmissionHandler) WithFilter added in v1.8.2

func (inner AdmissionHandler) WithFilter(configuration config.Configuration) AdmissionHandler

func (AdmissionHandler) WithMetrics added in v1.8.2

func (inner AdmissionHandler) WithMetrics(logger logr.Logger, metricsConfig config.MetricsConfiguration, attrs ...attribute.KeyValue) AdmissionHandler

func (AdmissionHandler) WithOperationFilter added in v1.9.0

func (inner AdmissionHandler) WithOperationFilter(operations ...admissionv1.Operation) AdmissionHandler

func (AdmissionHandler) WithProtection added in v1.8.2

func (inner AdmissionHandler) WithProtection(enabled bool) AdmissionHandler

func (AdmissionHandler) WithRoles added in v1.10.0

func (AdmissionHandler) WithSubResourceFilter added in v1.9.0

func (inner AdmissionHandler) WithSubResourceFilter(subresources ...string) AdmissionHandler

func (AdmissionHandler) WithTopLevelGVK added in v1.10.0

func (inner AdmissionHandler) WithTopLevelGVK(
	client dclient.IDiscovery,
) AdmissionHandler

func (AdmissionHandler) WithTrace added in v1.9.0

func (inner AdmissionHandler) WithTrace(name string) AdmissionHandler

type AdmissionRequest added in v1.10.0

type AdmissionRequest struct {
	// AdmissionRequest is the original admission request.
	admissionv1.AdmissionRequest

	// Roles is a list of possible role send the request.
	Roles []string

	// ClusterRoles is a list of possible clusterRoles send the request.
	ClusterRoles []string

	// GroupVersionKind is the top level GVK.
	GroupVersionKind schema.GroupVersionKind

	URLParams string
}

type AdmissionResponse added in v1.10.0

type AdmissionResponse = admissionv1.AdmissionResponse

func Verify

func Verify(ctx context.Context, logger logr.Logger, request AdmissionRequest, startTime time.Time) AdmissionResponse

type HttpHandler added in v1.9.0

type HttpHandler func(http.ResponseWriter, *http.Request)

func (HttpHandler) ToHandlerFunc added in v1.9.0

func (h HttpHandler) ToHandlerFunc(operation string) http.HandlerFunc

func (HttpHandler) WithMetrics added in v1.9.0

func (inner HttpHandler) WithMetrics(logger logr.Logger, attrs ...attribute.KeyValue) HttpHandler

func (HttpHandler) WithTrace added in v1.9.0

func (inner HttpHandler) WithTrace(name string) HttpHandler

Jump to

Keyboard shortcuts

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