controller

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0 Imports: 54 Imported by: 4

Documentation

Index

Constants

View Source
const LeaderElectionAnnotation = "control-plane.alpha.kubernetes.io/leader"

LeaderElectionAnnotation is the annotatation used on resources for leader election

View Source
const (
	// SCCAnnotation is the annotation listing SCCs for a SA
	SCCAnnotation = "cdi-scc"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

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

func GetConditionValues added in v1.10.3

func GetConditionValues(conditionList []conditions.Condition) map[conditions.ConditionType]corev1.ConditionStatus

GetConditionValues gets the conditions and put them into a map for easy comparison

func MarkCrDeploying added in v1.10.3

func MarkCrDeploying(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrDeploying marks the passed CR as currently deploying. The CR object needs to be updated by the caller afterwards. Deploying means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: false

func MarkCrFailed added in v1.10.3

func MarkCrFailed(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrFailed marks the passed CR as failed and requiring human intervention. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: false Progressing: false Degraded: true

func MarkCrFailedHealing added in v1.10.3

func MarkCrFailedHealing(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrFailedHealing marks the passed CR as failed and healing. The CR object needs to be updated by the caller afterwards. FailedAndHealing means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: true

func MarkCrHealthyMessage added in v1.10.3

func MarkCrHealthyMessage(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrHealthyMessage marks the passed in CR as healthy. The CR object needs to be updated by the caller afterwards. Healthy means the following status conditions are set: ApplicationAvailable: true Progressing: false Degraded: false

func MarkCrUpgradeHealingDegraded added in v1.10.3

func MarkCrUpgradeHealingDegraded(cr *cdiv1alpha1.CDI, reason, message string)

MarkCrUpgradeHealingDegraded marks the passed CR as upgrading and degraded. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: true Progressing: true Degraded: true

func NewIgnoreLeaderElectionPredicate added in v1.13.0

func NewIgnoreLeaderElectionPredicate() predicate.Predicate

NewIgnoreLeaderElectionPredicate returns a predicate used for ignoring leader election resources

Types

type CertManager added in v1.13.0

type CertManager interface {
	Sync(certs []cdicerts.CertificateDefinition) error
}

CertManager is the client interface to the certificate manager/refresher

func NewCertManager added in v1.13.0

func NewCertManager(mgr manager.Manager, installNamespace string, additionalNamespaces ...string) (CertManager, error)

NewCertManager creates a new certificate manager/refresher

type IgnoreWithMeta added in v1.13.0

type IgnoreWithMeta struct {
	LabelKeys      []string
	AnnotationKeys []string
}

IgnoreWithMeta ignores resources with specified labels/annotations

func (*IgnoreWithMeta) Create added in v1.13.0

func (p *IgnoreWithMeta) Create(e event.CreateEvent) bool

Create implements Predicate

func (*IgnoreWithMeta) Delete added in v1.13.0

func (p *IgnoreWithMeta) Delete(e event.DeleteEvent) bool

Delete implements Predicate

func (*IgnoreWithMeta) Generic added in v1.13.0

func (p *IgnoreWithMeta) Generic(e event.GenericEvent) bool

Generic implements Predicate

func (*IgnoreWithMeta) Update added in v1.13.0

func (p *IgnoreWithMeta) Update(e event.UpdateEvent) bool

Update implements Predicate

type ReconcileCDI

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

ReconcileCDI reconciles a CDI object

func (*ReconcileCDI) Reconcile

func (r *ReconcileCDI) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a CDI object and makes changes based on the state read and what is in the CDI.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type ReconcileCallback added in v1.10.3

type ReconcileCallback func(args *ReconcileCallbackArgs) error

ReconcileCallback is the callback function

type ReconcileCallbackArgs added in v1.10.3

type ReconcileCallbackArgs struct {
	Logger    logr.Logger
	Client    client.Client
	Scheme    *runtime.Scheme
	Namespace string
	Resource  *cdiv1alpha1.CDI

	State         ReconcileState
	DesiredObject runtime.Object
	CurrentObject runtime.Object
}

ReconcileCallbackArgs contains the data of a ReconcileCallback

type ReconcileState added in v1.10.3

type ReconcileState string

ReconcileState is the current state of the reconcile for a particuar resource

const (
	// ReconcileStatePreCreate is the state before a resource is created
	ReconcileStatePreCreate ReconcileState = "PRE_CREATE"
	// ReconcileStatePostCreate is the state sfter a resource is created
	ReconcileStatePostCreate ReconcileState = "POST_CREATE"

	// ReconcileStatePostRead is the state sfter a resource is read
	ReconcileStatePostRead ReconcileState = "POST_READ"

	// ReconcileStatePreUpdate is the state before a resource is updated
	ReconcileStatePreUpdate ReconcileState = "PRE_UPDATE"
	// ReconcileStatePostUpdate is the state after a resource is updated
	ReconcileStatePostUpdate ReconcileState = "POST_UPDATE"

	// ReconcileStatePreDelete is the state before a resource is explicitly deleted (probably during upgrade)
	// don't count on this always being called for your resource
	// ideally we just let garbage collection do it's thing
	ReconcileStatePreDelete ReconcileState = "PRE_DELETE"
	// ReconcileStatePostDelete is the state after a resource is explicitly deleted (probably during upgrade)
	// don't count on this always being called for your resource
	// ideally we just let garbage collection do it's thing
	ReconcileStatePostDelete ReconcileState = "POST_DELETE"

	// ReconcileStateCDIDelete is called during CDI finalizer
	ReconcileStateCDIDelete ReconcileState = "CDI_DELETE"
)

Jump to

Keyboard shortcuts

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