tls

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Log is the logger used by the webhook tls provider.
	Log logr.Logger

	// RestConfig is the shared base rest config to connect to the Kubernetes
	// API.
	RestConfig *rest.Config

	// WebhookCertificatesDir is the directory that holds the certificate and key
	// (tls.crt, tls.key) which are used to server the Webhook server. The
	// TLS proivder waits for these files to become available before returning
	// from New().
	WebhookCertificatesDir string

	// CASecretNamespace is the namespace that the
	// cert-manager-approver-policy-tls Secret is stored.
	CASecretNamespace string

	// ServiceName is the name of the service that exposes the webhook server.
	// This name will be used as the DNS SAN entry to the webhook's serving
	// certificate.
	ServiceName string
}

Options hold options for the approver-policy Webhook TLS provider.

type TLS

type TLS struct {
	// contains filtered or unexported fields
}

TLS is a TLS provider which is used for populating a serving key and certificate for the webhook server.

func New

func New(ctx context.Context, opts Options) (*TLS, error)

New constructs a TLS provider. The provider will ensure that a certificate and key pair are available for serving the webhook.

func (*TLS) NeedLeaderElection

func (t *TLS) NeedLeaderElection() bool

All webhook TLS providers need to keep their respective key and certificate up-to-date, regardless of whether they are leader or not.

func (*TLS) Start

func (t *TLS) Start(ctx context.Context) error

Start will start the TLS provider which ensures that the webhook server always has a valid certificate and key for the current serving CA.

Jump to

Keyboard shortcuts

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