Documentation ¶
Index ¶
- Constants
- Variables
- func ExpirationDateExpired(timestamp *metav1.Time) bool
- func FilterSeedForShootConditions(obj, oldObj, _ client.Object, _ bool) bool
- func ForceMachineImageUpdateRequired(shootCurrentImage *gardencorev1beta1.ShootMachineImage, ...) bool
- func GroupHibernationSchedulesByLocation(schedules []gardencorev1beta1.HibernationSchedule) map[string][]gardencorev1beta1.HibernationSchedule
- func LocationLogger(logger logrus.FieldLogger, location *time.Location) logrus.FieldLogger
- func MaintainMachineImages(shootLogger *logrus.Entry, shoot *gardencorev1beta1.Shoot, ...) ([]string, error)
- func NewHibernationJob(ctx context.Context, gardenClient client.Client, logger logrus.FieldLogger, ...) cron.Job
- func NewShootConditionsReconciler(logger logrus.FieldLogger, gardenClient client.Client) reconcile.Reconciler
- func NewShootHibernationReconciler(l logrus.FieldLogger, gardenClient client.Client, ...) reconcile.Reconciler
- func NewShootMaintenanceReconciler(l logrus.FieldLogger, gardenClient client.Client, ...) reconcile.Reconciler
- func NewShootQuotaReconciler(l logrus.FieldLogger, gardenClient client.Client, ...) reconcile.Reconciler
- func NewShootReferenceReconciler(l logrus.FieldLogger, gardenClient kubernetes.Interface, ...) reconcile.Reconciler
- func NewShootRetryReconciler(l logrus.FieldLogger, gardenClient client.Client, ...) reconcile.Reconciler
- func NewShootStatusLabelReconciler(logger logrus.FieldLogger, gardenClient client.Client) reconcile.Reconciler
- type Controller
- type Cron
- type HibernationSchedule
- type HibernationScheduleRegistry
Constants ¶
const FinalizerName = "gardener.cloud/reference-protection"
FinalizerName is the name of the finalizer used for the reference protection.
Variables ¶
var ( // NewCronWithLocation creates a new cron with the given location. Exposed for testing. NewCronWithLocation = newCronWithLocation // TimeNow returns the current time. Exposed for testing. TimeNow = time.Now )
var ( // UserManagedSelector is a selector for objects which are managed by users and not created by Gardener. UserManagedSelector = client.MatchingLabelsSelector{Selector: labels.NewSelector().Add(noGardenRole)} )
Functions ¶
func ExpirationDateExpired ¶
ExpirationDateExpired returns if now is equal or after the given expirationDate
func FilterSeedForShootConditions ¶ added in v1.37.6
FilterSeedForShootConditions is used as a ControllerPredicateFactoryFunc to ensure that Shoots are only enqueued when Seed conditions changed.
func ForceMachineImageUpdateRequired ¶
func ForceMachineImageUpdateRequired(shootCurrentImage *gardencorev1beta1.ShootMachineImage, imageCloudProvider gardencorev1beta1.MachineImage) bool
ForceMachineImageUpdateRequired checks if the shoots current machine image has to be forcefully updated
func GroupHibernationSchedulesByLocation ¶
func GroupHibernationSchedulesByLocation(schedules []gardencorev1beta1.HibernationSchedule) map[string][]gardencorev1beta1.HibernationSchedule
GroupHibernationSchedulesByLocation groups the given HibernationSchedules by their Location. If the Location of a HibernationSchedule is `nil`, it is defaulted to UTC.
func LocationLogger ¶
func LocationLogger(logger logrus.FieldLogger, location *time.Location) logrus.FieldLogger
LocationLogger returns a logger for the given location.
func MaintainMachineImages ¶
func MaintainMachineImages(shootLogger *logrus.Entry, shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile) ([]string, error)
MaintainMachineImages updates the machine images of a Shoot's worker pools if necessary
func NewHibernationJob ¶
func NewHibernationJob(ctx context.Context, gardenClient client.Client, logger logrus.FieldLogger, recorder record.EventRecorder, target *gardencorev1beta1.Shoot, enabled bool) cron.Job
NewHibernationJob creates a new cron.Job that sets the hibernation of the given shoot to enabled when it triggers.
func NewShootConditionsReconciler ¶ added in v1.37.0
func NewShootConditionsReconciler(logger logrus.FieldLogger, gardenClient client.Client) reconcile.Reconciler
NewShootConditionsReconciler creates a reconcile.Reconciler that updates the conditions of a shoot that is registered as seed.
func NewShootHibernationReconciler ¶ added in v1.19.0
func NewShootHibernationReconciler( l logrus.FieldLogger, gardenClient client.Client, hibernationScheduleRegistry HibernationScheduleRegistry, recorder record.EventRecorder, ) reconcile.Reconciler
NewShootHibernationReconciler creates a new instance of a reconciler which hibernates shoots or wakes them up.
func NewShootMaintenanceReconciler ¶ added in v1.19.0
func NewShootMaintenanceReconciler(l logrus.FieldLogger, gardenClient client.Client, config config.ShootMaintenanceControllerConfiguration, recorder record.EventRecorder) reconcile.Reconciler
NewShootMaintenanceReconciler creates a new instance of a reconciler which maintains Shoots.
func NewShootQuotaReconciler ¶ added in v1.19.0
func NewShootQuotaReconciler(l logrus.FieldLogger, gardenClient client.Client, cfg config.ShootQuotaControllerConfiguration) reconcile.Reconciler
NewShootQuotaReconciler creates a new instance of a reconciler which checks handles Shoots using SecretBindings that references Quotas.
func NewShootReferenceReconciler ¶ added in v1.12.0
func NewShootReferenceReconciler(l logrus.FieldLogger, gardenClient kubernetes.Interface, config *config.ShootReferenceControllerConfiguration) reconcile.Reconciler
NewShootReferenceReconciler creates a new instance of a reconciler which checks object references from shoot objects.
func NewShootRetryReconciler ¶ added in v1.22.0
func NewShootRetryReconciler(l logrus.FieldLogger, gardenClient client.Client, config *config.ShootRetryControllerConfiguration) reconcile.Reconciler
NewShootRetryReconciler creates a new instance of a reconciler which retries certain failed Shoots.
func NewShootStatusLabelReconciler ¶ added in v1.37.0
func NewShootStatusLabelReconciler(logger logrus.FieldLogger, gardenClient client.Client) reconcile.Reconciler
NewShootStatusLabelReconciler creates a reconcile.Reconciler that updates a shoot's status label.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller controls Shoots.
func NewShootController ¶
func NewShootController( ctx context.Context, clientMap clientmap.ClientMap, config *config.ControllerManagerConfiguration, recorder record.EventRecorder, ) ( *Controller, error, )
NewShootController takes a ClientMap, a GardenerInformerFactory, a KubernetesInformerFactory, a ControllerManagerConfig struct and an EventRecorder to create a new Shoot controller.
func (*Controller) Run ¶
func (c *Controller) Run( ctx context.Context, shootMaintenanceWorkers, shootQuotaWorkers, shootHibernationWorkers, shootReferenceWorkers, shootRetryWorkers, shootConditionsWorkers, shootStatusLabelWorkers int, )
Run runs the Controller until the given stop channel can be read from.
type HibernationSchedule ¶
HibernationSchedule is a mapping from location to a Cron. It controls the hibernation process of a certain shoot.
func ComputeHibernationSchedule ¶
func ComputeHibernationSchedule(ctx context.Context, gardenClient client.Client, logger logrus.FieldLogger, recorder record.EventRecorder, shoot *gardencorev1beta1.Shoot) (HibernationSchedule, error)
ComputeHibernationSchedule computes the HibernationSchedule for the given Shoot.
type HibernationScheduleRegistry ¶
type HibernationScheduleRegistry interface { Load(key string) (schedule HibernationSchedule, ok bool) Store(key string, schedule HibernationSchedule) Delete(key string) }
HibernationScheduleRegistry is a goroutine-safe mapping of Shoot key to HibernationSchedule.
func NewHibernationScheduleRegistry ¶
func NewHibernationScheduleRegistry() HibernationScheduleRegistry
NewHibernationScheduleRegistry instantiates a new HibernationScheduleRegistry.