webhook

package
v0.0.0-...-beceb34 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWebhookCerts

func GenerateWebhookCerts(certDir, webhookServiceNs, webhookServiceName string) ([]byte, error)

GenerateWebhookCerts generate self singed CA and a signed cert pair. The signed pair is stored at the certDir. The CA will respect the inCluster DNS

func GetValidatorName

func GetValidatorName(wbhName string) string

func GetWebHookServiceName

func GetWebHookServiceName(wbhName string) string

Types

type Certificate

type Certificate struct {
	Cert string
	Key  string
}

Certificate defines a typical cert structure

func GenerateSelfSignedCACert

func GenerateSelfSignedCACert(cn string) (Certificate, error)

GenerateSelfSignedCACert generates a self signed CA

func GenerateSignedCert

func GenerateSignedCert(cn string, alternateDNS []string, ca Certificate) (Certificate, error)

GenerateSignedCert generated cert pair which is signed by the self signed CA

type WireUp

type WireUp struct {
	Server  *webhook.Server
	Handler webhook.AdmissionHandler
	CertDir string
	logr.Logger

	WebhookName string
	WebHookPort int

	WebHookeSvcKey     types.NamespacedName
	WebHookServicePort int

	ValidtorPath string

	DeployLabel        string
	DeploymentSelector map[string]string
	// contains filtered or unexported fields
}

func NewWireUp

func NewWireUp(mgr manager.Manager, stop <-chan struct{},
	opts ...func(*WireUp)) (*WireUp, error)

func (*WireUp) Attach

func (w *WireUp) Attach() ([]byte, error)

func (*WireUp) WireUpWebhookSupplymentryResource

func (w *WireUp) WireUpWebhookSupplymentryResource(caCert []byte, gvk schema.GroupVersionKind, ops []admissionv1.OperationType)

assuming we have a service set up for the webhook, and the service is linking to a secret which has the CA

Jump to

Keyboard shortcuts

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