controllers

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package controllers implements the OriginIssuer and CertificateRequest Kubernetes controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IssuerHasCondition

func IssuerHasCondition(iss v1.OriginIssuer, c v1.OriginIssuerCondition) bool

IssuerHasCondition will return true if the given OriginIssuer has a condition matching the provided OriginIssuerCondtion. Only the Type and Status fields are used in the comparison, meaning this function will return `true` even if the Reason, Message, and LastTransitionTime fields do not match.

func SetIssuerCondition

func SetIssuerCondition(iss *v1.OriginIssuer, conditionType v1.ConditionType, status v1.ConditionStatus, log logr.Logger, cl clock.Clock, reason, message string)

SetIssuerCondition will set a condition on the given OriginIssuer.

If no condition of the same type exists, the condition will be inserted with the LastTransitionTime set to the current time.

If a condition of the same type and status already exists, the condition will be updated but the LastTransitionTime will no be modified.

If a condition of the same type and different state already exists, the condition will be updated and the LastTransitionTime set to the current time.

Types

type CertificateRequestController

type CertificateRequestController struct {
	client.Client
	Log        logr.Logger
	Collection *provisioners.Collection

	Clock                  clock.Clock
	CheckApprovedCondition bool
}

CertificateRequestController implements a controller that reconciles CertificateRequests that references this controller.

func (*CertificateRequestController) Reconcile

Reconcile reconciles CertificateRequest by fetching a Cloudflare API provisioner from the referenced OriginIssuer, and providing the request's CSR.

type OriginIssuerController

type OriginIssuerController struct {
	client.Client
	Log        logr.Logger
	Clock      clock.Clock
	Factory    cfapi.Factory
	Collection *provisioners.Collection
}

OriginIssuerController implements a controller that watches for changes to OriginIssuer resources.

func (*OriginIssuerController) Reconcile

Reconcile reconciles OriginIssuer resources by managing Cloudflare API provisioners.

Jump to

Keyboard shortcuts

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