webhook

package
v0.5.1-0...-ae23026 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProxyContainerPath

func GetProxyContainerPath(spec corev1.PodSpec) string

GetProxyContainerPath gets the proxy container jsonpath of a pod relative to spec; this path is required in webhooks because of how patches are created.

func Launch

func Launch(
	ctx context.Context,
	apiresources []k8s.APIResource,
	handler Handler,
	component,
	metricsAddr string,
	addr string,
	kubeconfig string,
	enablePprof bool,
)

Launch sets up and starts the webhook and metrics servers

Types

type Handler

Handler is the signature for the functions that ultimately deal with the admission request

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server describes the https server implementing the webhook

func NewServer

func NewServer(
	ctx context.Context,
	api *pkgk8s.KubernetesAPI,
	metadataAPI *k8s.MetadataAPI,
	addr, certPath string,
	handler Handler,
	component string,
) (*Server, error)

NewServer returns a new instance of Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown initiates a graceful shutdown of the underlying HTTP server.

func (*Server) Start

func (s *Server) Start()

Start starts the https server

Jump to

Keyboard shortcuts

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