server

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TLSReadyReadinessProbe

func TLSReadyReadinessProbe(webhook *Webhook) http.HandlerFunc

TLSReadyReadinessProbe defines a readiness check for a Webhook struct based on the presence of its TLS certificate and key. It requires the whole webhook as parameter to be able to RLock on the certificate for the presence confirmation.

Types

type Webhook

type Webhook struct {
	sync.RWMutex
	CertFile    string
	KeyFile     string
	Cert        *tls.Certificate
	ClusterName string
	Logger      *zap.SugaredLogger
	Server      *http.Server
	CertWatcher *fsnotify.Watcher
}

Webhook is a webhook server that can accept requests from the Apiserver

func (*Webhook) GetCert

func (whsvr *Webhook) GetCert(*tls.ClientHelloInfo) (*tls.Certificate, error)

GetCert returns the certificate that should be used by the server in the TLS handshake.

func (*Webhook) ServeHTTP

func (whsvr *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request)

Serve method for webhook server

Jump to

Keyboard shortcuts

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