helper

package
v1.75.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 13 Imported by: 0

Documentation

Overview

Package helper contains helpers for the gardenlet's shoot main controller. Helper functions that determine critical information for the controller's operations can be placed here to define a clear boundary line between the controller itself and its helpers. All exported functions (this package's interface), i.e., functions shared with the controller, should be unit tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeOperationType

func ComputeOperationType(shoot *gardencorev1beta1.Shoot) gardencorev1beta1.LastOperationType

ComputeOperationType determines which operation should be executed when acting on the given shoot.

func GetEtcdDeployTimeout

func GetEtcdDeployTimeout(shoot *shoot.Shoot, defaultDuration time.Duration) time.Duration

GetEtcdDeployTimeout returns the timeout for the etcd deployment task of the reconcile flow.

func IsSeedReadyForMigration

func IsSeedReadyForMigration(seed *gardencorev1beta1.Seed, identity *gardencorev1beta1.Gardener) error

IsSeedReadyForMigration checks if the seed can be used as a target seed for migrating a shoot control plane. If the seed is ready, it returns nil. Otherwise, it returns an error with a description.

func ShouldPrepareShootForMigration

func ShouldPrepareShootForMigration(shoot *gardencorev1beta1.Shoot) bool

ShouldPrepareShootForMigration determines whether the controller should prepare the shoot control plane for migration to another seed.

Types

type ControllerInfos

type ControllerInfos struct {
	// OperationType is the operation that should be executed when acting on the given shoot.
	// Note: this can contain an operation type that is different to the operation that was just performed.
	// E.g., when re-calculating the infos after a successful Create operation, this field will be set to Reconcile, as
	// the next operation that should be performed on the shoot is a usual Reconcile operation.
	OperationType gardencorev1beta1.LastOperationType
	// ShouldReconcileNow is true if the controller should perform reconciliations immediately.
	// This is supposed to be used in the reconciler only.
	ShouldReconcileNow bool
	// ShouldOnlySyncClusterResource is true if the controller should not perform reconciliations right now
	// (ShouldReconcileNow == false) but the controller should still sync the cluster resource to the seed.
	ShouldOnlySyncClusterResource bool
	// EnqueueAfter is the duration after which the shoot should be reconciled after observing an ADD watch event
	// (on shoot creation and on initial listing of all shoots on gardenlet startup).
	// This is supposed to be used in the add event handler only.
	EnqueueAfter time.Duration
	// RequeueAfter is the reconciliation result that should be returned by the reconciler for scheduling the next
	// regular sync in the following two situations only:
	// - after finishing a shoot Create/Reconcile/Restore operation successfully
	// - when handling a reconciliation request for a shoot that should not be reconciled right now (ShouldReconcileNow == false)
	RequeueAfter reconcile.Result
	// contains filtered or unexported fields
}

ControllerInfos is the result of CalculateControllerInfos and informs the controller about whether and when a given shoot should be reconciled. These results are supposed to be used/handled immediately. Always call CalculateControllerInfos to re-calculate the results before using them. The exported fields are the exposed results, all other fields are for internal computations only.

func CalculateControllerInfos

CalculateControllerInfos calculates whether and when a given shoot should be reconciled. These results are supposed to be used/handled immediately. Always call CalculateControllerInfos to re-calculate the results before using them.

Jump to

Keyboard shortcuts

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