webhookca

package
v0.0.0-...-b4381ef Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ServiceMeshControlPlaneCRDName = "servicemeshcontrolplanes.maistra.io"
	ServiceMeshExtensionCRDName    = "servicemeshextensions.maistra.io"
)

Variables

View Source
var WebhookCABundleManagerInstance = newWebhookCABundleManager()

WebhookCABundleManagerInstance is a singleton used to manage the caBundle on a webhook's clientConfig.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type CABundleSource

type CABundleSource interface {
	GetCABundle(ctx context.Context, client client.Client) ([]byte, error)
	GetNamespace() string
	SetNamespace(string)
	MatchedObjects() []ObjectRef
	Copy() CABundleSource
}

type ConfigMapCABundleSource

type ConfigMapCABundleSource struct {
	ConfigMapName string
	Key           string
	Namespace     string
}

func (*ConfigMapCABundleSource) Copy

func (*ConfigMapCABundleSource) GetCABundle

func (s *ConfigMapCABundleSource) GetCABundle(ctx context.Context, client client.Client) ([]byte, error)

func (*ConfigMapCABundleSource) GetNamespace

func (s *ConfigMapCABundleSource) GetNamespace() string

func (*ConfigMapCABundleSource) MatchedObjects

func (s *ConfigMapCABundleSource) MatchedObjects() []ObjectRef

func (*ConfigMapCABundleSource) SetNamespace

func (s *ConfigMapCABundleSource) SetNamespace(namespace string)

type ObjectRef

type ObjectRef struct {
	Kind      string
	Namespace string
	Name      string
}

type SecretCABundleSource

type SecretCABundleSource struct {
	Namespace          string
	SecretNameKeyPairs []SecretNameKeyPair
}

func (*SecretCABundleSource) Copy

func (*SecretCABundleSource) GetCABundle

func (s *SecretCABundleSource) GetCABundle(ctx context.Context, client client.Client) ([]byte, error)

func (*SecretCABundleSource) GetNamespace

func (s *SecretCABundleSource) GetNamespace() string

func (*SecretCABundleSource) MatchedObjects

func (s *SecretCABundleSource) MatchedObjects() []ObjectRef

func (*SecretCABundleSource) SetNamespace

func (s *SecretCABundleSource) SetNamespace(namespace string)

type SecretNameKeyPair

type SecretNameKeyPair struct {
	SecretName string
	Key        string
}

type WebhookCABundleManager

type WebhookCABundleManager interface {
	// ManageWebhookCABundle adds a webhook to the manager.
	ManageWebhookCABundle(obj runtime.Object, source CABundleSource) error
	// UnmanageWebhookCABundle removes a webhook from the manager.
	UnmanageWebhookCABundle(obj runtime.Object) error
	// IsManaged returns true if the webhook is being managed.
	IsManaged(obj runtime.Object) bool
	// IsManagingWebhooksForSource returns true if any webhooks being managed are using the secret or config map.
	IsManagingWebhooksForSource(obj ObjectRef) bool
	// ReconcileRequestsFromSource returns a slice of reconcile.Request objects for the specified secret or config map
	ReconcileRequestsFromSource(obj ObjectRef) []reconcile.Request
	// ReconcileRequestsFromWebhook returns a slice of reconcile.Request objects for the specified webhook
	ReconcileRequestsFromWebhook(webhook runtime.Object) []reconcile.Request
	// UpdateCABundle updates the caBundle for the webhook.  The webhook namespace identifies the type of webhook (validating or mutating).
	UpdateCABundle(ctx context.Context, cl client.Client, webhook types.NamespacedName) error
}

WebhookCABundleManager is the public interface for managing webhook caBundle.

Jump to

Keyboard shortcuts

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