controllers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateRequestPredicate

type CertificateRequestPredicate struct {
	predicate.Funcs
}

This predicate is used to indicate when a CertificateRequest event should trigger a reconciliation of itself.

In these cases we want to trigger: - an annotation changed/ was added or removed - a status condition was added or removed - a status condition that does not have type == Ready was changed (aka. other Status value)

func (CertificateRequestPredicate) Update

type CertificateRequestReconciler

type CertificateRequestReconciler struct {
	IssuerTypes        []v1alpha1.Issuer
	ClusterIssuerTypes []v1alpha1.Issuer

	FieldOwner       string
	MaxRetryDuration time.Duration
	EventSource      kubeutil.EventSource

	// Client is a controller-runtime client used to get and set K8S API resources
	client.Client
	// Sign connects to a CA and returns a signed certificate for the supplied CertificateRequest.
	signer.Sign

	// EventRecorder is used for creating Kubernetes events on resources.
	EventRecorder record.EventRecorder

	// Clock is used to mock condition transition times in tests.
	Clock clock.PassiveClock

	// SetCAOnCertificateRequest is used to enable setting the CA status field on
	// the CertificateRequest resource. This is disabled by default.
	// Deprecated: this option is for backwards compatibility only. The use of
	// ca.crt is discouraged. Instead, the CA certificate should be provided
	// separately using a tool such as trust-manager.
	SetCAOnCertificateRequest bool

	PostSetupWithManager func(context.Context, schema.GroupVersionKind, ctrl.Manager, controller.Controller) error
}

CertificateRequestReconciler reconciles a CertificateRequest object

func (*CertificateRequestReconciler) Reconcile

func (r *CertificateRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, returnedError error)

func (*CertificateRequestReconciler) SetupWithManager

func (r *CertificateRequestReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

It ensures that the Manager scheme has all the types that are needed by this controller. It sets up indexing of CertificateRequests by issuerRef to allow fast lookups of all the CertificateRequest resources associated with a particular Issuer / ClusterIssuer. It configures the controller re-reconcile all the related CertificateRequests when an Issuer / ClusterIssuer is created or when it changes. This ensures that a CertificateRequest will be properly reconciled regardless of whether the Issuer it references is created before or afterwards.

type CertificateSigningRequestPredicate

type CertificateSigningRequestPredicate struct {
	predicate.Funcs
}

This predicate is used to indicate when a CertificateSigningRequest event should trigger a reconciliation of itself.

In these cases we want to trigger: - an annotation changed/ was added or removed - a status condition was added or removed - a status condition was changed

func (CertificateSigningRequestPredicate) Update

type CertificateSigningRequestReconciler

type CertificateSigningRequestReconciler struct {
	IssuerTypes        []v1alpha1.Issuer
	ClusterIssuerTypes []v1alpha1.Issuer

	FieldOwner       string
	MaxRetryDuration time.Duration
	EventSource      kubeutil.EventSource

	// Client is a controller-runtime client used to get and set K8S API resources
	client.Client
	// Sign connects to a CA and returns a signed certificate for the supplied CertificateRequest.
	signer.Sign

	// EventRecorder is used for creating Kubernetes events on resources.
	EventRecorder record.EventRecorder

	// Clock is used to mock condition transition times in tests.
	Clock clock.PassiveClock

	PostSetupWithManager func(context.Context, schema.GroupVersionKind, ctrl.Manager, controller.Controller) error
}

CertificateSigningRequestReconciler reconciles a CertificateRequest object

func (*CertificateSigningRequestReconciler) Reconcile

func (r *CertificateSigningRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, returnedError error)

func (*CertificateSigningRequestReconciler) SetupWithManager

func (r *CertificateSigningRequestReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

It ensures that the Manager scheme has all the types that are needed by this controller. It sets up indexing of CertificateRequests by issuerRef to allow fast lookups of all the CertificateRequest resources associated with a particular Issuer / ClusterIssuer. It configures the controller re-reconcile all the related CertificateRequests when an Issuer / ClusterIssuer is created or when it changes. This ensures that a CertificateRequest will be properly reconciled regardless of whether the Issuer it references is created before or afterwards.

type CombinedController

type CombinedController struct {
	IssuerTypes        []v1alpha1.Issuer
	ClusterIssuerTypes []v1alpha1.Issuer

	FieldOwner string

	MaxRetryDuration time.Duration

	// Check connects to a CA and checks if it is available
	signer.Check
	// Sign connects to a CA and returns a signed certificate for the supplied CertificateRequest.
	signer.Sign

	// EventRecorder is used for creating Kubernetes events on resources.
	EventRecorder record.EventRecorder

	// Clock is used to mock condition transition times in tests.
	Clock clock.PassiveClock

	// SetCAOnCertificateRequest is used to enable setting the CA status field on
	// the CertificateRequest resource. This is disabled by default.
	// Deprecated: this option is for backwards compatibility only. The use of
	// ca.crt is discouraged. Instead, the CA certificate should be provided
	// separately using a tool such as trust-manager.
	SetCAOnCertificateRequest bool

	PostSetupWithManager func(context.Context, schema.GroupVersionKind, ctrl.Manager, controller.Controller) error
}

func (*CombinedController) SetupWithManager

func (r *CombinedController) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

type IssuerPredicate

type IssuerPredicate struct {
	predicate.Funcs
}

Predicate for Issuer events that should trigger the Issuer reconciler

In these cases we want to trigger: - an annotation changed/ was added or removed - the generation changed - the Ready condition was added/ removed

func (IssuerPredicate) Update

Update implements default UpdateEvent filter for validating generation change.

type IssuerReconciler

type IssuerReconciler struct {
	ForObject v1alpha1.Issuer

	FieldOwner  string
	EventSource kubeutil.EventSource

	// Client is a controller-runtime client used to get and set K8S API resources
	client.Client
	// Check connects to a CA and checks if it is available
	signer.Check

	// EventRecorder is used for creating Kubernetes events on resources.
	EventRecorder record.EventRecorder

	// Clock is used to mock condition transition times in tests.
	Clock clock.PassiveClock

	PostSetupWithManager func(context.Context, schema.GroupVersionKind, ctrl.Manager, controller.Controller) error
}

IssuerReconciler reconciles a SimpleIssuer object

func (*IssuerReconciler) Reconcile

func (r *IssuerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, returnedError error)

func (*IssuerReconciler) SetupWithManager

func (r *IssuerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type LinkedIssuerPredicate

type LinkedIssuerPredicate struct {
	predicate.Funcs
}

Predicate for Issuer events that should trigger the CertificateRequest reconciler

In these cases we want to trigger: - the Ready condition was added/ removed - the Ready condition's Status property changed

func (LinkedIssuerPredicate) Update

Update implements default UpdateEvent filter for validating resource version change.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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