webhooks

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 29 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithoutCA = withoutCA{}

Functions

func GenerateCertificate

func GenerateCertificate(ctx context.Context, c client.Client, options ...CertOption) error

GenerateCertificate

func Install

func Install(
	ctx context.Context,
	c client.Client,
	scheme *runtime.Scheme,
	apiTypes []APITypes,
	options ...InstallOption,
) error

func Uninstall added in v0.23.3

func Uninstall(
	ctx context.Context,
	c client.Client,
	scheme *runtime.Scheme,
	apiTypes []APITypes,
	options ...InstallOption,
) error

Types

type APITypes added in v0.24.0

type APITypes struct {
	// Obj is the API type object.
	Obj client.Object
	// Validator indicates whether the type has a validating webhook.
	Validator bool
	// Defaulter indicates whether the type has a mutating webhook.
	Defaulter bool
	// Mutation allows to mutate the webhooks before they are created or updated. Use with caution, as it may break the webhooks or interfere with the library's management of the resources.
	Mutation Mutation
}

APITypes defines an API type along with whether it has a validator and/or defaulter webhook.

type CertOption added in v0.23.3

type CertOption interface {
	ApplyToCertOptions(o *certOptions)
}

type Flags

type Flags struct {
	Install        bool
	InstallOptions []InstallOption
	CertOptions    []CertOption
	BindHost       string
	BindPort       int
}

func BindFlags

func BindFlags(fs *flag.FlagSet) *Flags

type InstallOption added in v0.23.3

type InstallOption interface {
	ApplyToInstallOptions(o *installOptions)
}

type MutatingMutation added in v0.26.0

type MutatingMutation func(webhook *admissionregistrationv1.MutatingWebhook) error

MutatingMutation is a function that can be used to mutate the mutating webhook before it is created or updated. Use with caution, as it may break the webhook or interfere with the library's management of the webhook.

type Mutation added in v0.26.0

type Mutation struct {
	ValidatingWebhook ValidatingMutation
	MutatingWebhook   MutatingMutation
}

type ValidatingMutation added in v0.26.0

type ValidatingMutation func(webhook *admissionregistrationv1.ValidatingWebhook) error

ValidatingMutation is a function that can be used to mutate the validating webhook before it is created or updated. Use with caution, as it may break the webhook or interfere with the library's management of the webhook.

type WithAdditionalDNSNames

type WithAdditionalDNSNames []string

func (WithAdditionalDNSNames) ApplyToCertOptions

func (opt WithAdditionalDNSNames) ApplyToCertOptions(o *certOptions)

type WithCustomBaseURL

type WithCustomBaseURL string

func (WithCustomBaseURL) ApplyToInstallOptions

func (opt WithCustomBaseURL) ApplyToInstallOptions(o *installOptions)

type WithCustomCA

type WithCustomCA []byte

func (WithCustomCA) ApplyToInstallOptions

func (opt WithCustomCA) ApplyToInstallOptions(o *installOptions)

type WithManagedLabels added in v0.23.3

type WithManagedLabels map[string]string

WithManagedLabels specifies labels which should be added to resources created by this library.

func (WithManagedLabels) ApplyToInstallOptions added in v0.23.3

func (opt WithManagedLabels) ApplyToInstallOptions(o *installOptions)

type WithManagedWebhookService added in v0.23.3

type WithManagedWebhookService struct {
	TargetPort     intstr.IntOrString
	SelectorLabels map[string]string
}

WithManagedWebhookService allows to have the webhook service created and managed by this library.

func (WithManagedWebhookService) ApplyToInstallOptions added in v0.23.3

func (opt WithManagedWebhookService) ApplyToInstallOptions(o *installOptions)

type WithRemoteClient

type WithRemoteClient struct {
	Client client.Client
}

func (WithRemoteClient) ApplyToInstallOptions

func (opt WithRemoteClient) ApplyToInstallOptions(o *installOptions)

type WithWebhookSecret

type WithWebhookSecret types.NamespacedName

func (WithWebhookSecret) ApplyToCertOptions

func (opt WithWebhookSecret) ApplyToCertOptions(o *certOptions)

func (WithWebhookSecret) ApplyToInstallOptions

func (opt WithWebhookSecret) ApplyToInstallOptions(o *installOptions)

type WithWebhookService

type WithWebhookService types.NamespacedName

func (WithWebhookService) ApplyToCertOptions

func (opt WithWebhookService) ApplyToCertOptions(o *certOptions)

func (WithWebhookService) ApplyToInstallOptions

func (opt WithWebhookService) ApplyToInstallOptions(o *installOptions)

type WithWebhookServicePort

type WithWebhookServicePort int32

func (WithWebhookServicePort) ApplyToInstallOptions

func (opt WithWebhookServicePort) ApplyToInstallOptions(o *installOptions)

Jump to

Keyboard shortcuts

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