managedseedset

package
v1.72.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCreatingShoot                   = "CreatingShoot"
	EventDeletingShoot                   = "DeletingShoot"
	EventRetryingShootReconciliation     = "RetryingShootReconciliation"
	EventNotRetryingShootReconciliation  = "NotRetryingShootReconciliation"
	EventRetryingShootDeletion           = "RetryingShootDeletion"
	EventNotRetryingShootDeletion        = "NotRetryingShootDeletion"
	EventWaitingForShootReconciled       = "WaitingForShootReconciled"
	EventWaitingForShootDeleted          = "WaitingForShootDeleted"
	EventWaitingForShootHealthy          = "WaitingForShootHealthy"
	EventCreatingManagedSeed             = "CreatingManagedSeed"
	EventDeletingManagedSeed             = "DeletingManagedSeed"
	EventWaitingForManagedSeedRegistered = "WaitingForManagedSeedRegistered"
	EventWaitingForManagedSeedDeleted    = "WaitingForManagedSeedDeleted"
	EventWaitingForSeedReady             = "WaitingForSeedReady"
)

Event reason constants.

View Source
const ControllerName = "managedseedset"

ControllerName is the name of this controller.

Variables

View Source
var Now = metav1.Now

Now returns the current local time. Exposed for testing.

Functions

This section is empty.

Types

type Actuator

type Actuator interface {
	// Reconcile reconciles ManagedSeedSet creation, update, or deletion.
	Reconcile(context.Context, logr.Logger, *seedmanagementv1alpha1.ManagedSeedSet) (*seedmanagementv1alpha1.ManagedSeedSetStatus, bool, error)
}

Actuator acts upon ManagedSeedSet resources.

func NewActuator

func NewActuator(
	gardenClient client.Client,
	replicaGetter ReplicaGetter,
	replicaFactory ReplicaFactory,
	cfg *config.ManagedSeedSetControllerConfiguration,
	recorder record.EventRecorder,
) Actuator

NewActuator creates and returns a new Actuator with the given parameters.

type Reconciler added in v1.58.0

type Reconciler struct {
	Client   client.Client
	Config   config.ManagedSeedSetControllerConfiguration
	Actuator Actuator
}

Reconciler reconciles the ManagedSeedSet.

func (*Reconciler) AddToManager added in v1.58.0

func (r *Reconciler) AddToManager(mgr manager.Manager) error

AddToManager adds Reconciler to the given manager.

func (*Reconciler) ManagedSeedPredicate added in v1.58.0

func (r *Reconciler) ManagedSeedPredicate() predicate.Predicate

ManagedSeedPredicate returns the predicate for ManagedSeed events.

func (*Reconciler) MapSeedToManagedSeedSet added in v1.58.0

func (r *Reconciler) MapSeedToManagedSeedSet(ctx context.Context, log logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request

MapSeedToManagedSeedSet is a mapper.MapFunc for mapping Seeds to referencing ManagedSeedSet.

func (*Reconciler) Reconcile added in v1.58.0

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile performs the main reconciliation logic.

func (*Reconciler) SeedPredicate added in v1.58.0

func (r *Reconciler) SeedPredicate() predicate.Predicate

SeedPredicate returns the predicate for Seed events.

func (*Reconciler) ShootPredicate added in v1.58.0

func (r *Reconciler) ShootPredicate() predicate.Predicate

ShootPredicate returns the predicate for Shoot events.

type Replica

type Replica interface {
	// GetName returns this replica's name.
	GetName() string
	// GetFullName returns this replica's full name.
	GetFullName() string
	// GetObjectKey returns this replica's ObjectKey.
	GetObjectKey() client.ObjectKey
	// GetOrdinal returns this replica's ordinal. If the replica has no ordinal, -1 is returned.
	GetOrdinal() int
	// GetStatus returns this replica's status. If the replica's managed seed doesn't exist,
	// it returns one of the StatusShoot* statuses, depending on the shoot state.
	// Otherwise, it returns one of the ManagedSeed* statuses, depending on the managed seed state.
	GetStatus() ReplicaStatus
	// IsSeedReady returns true if this replica's seed is ready, false otherwise.
	IsSeedReady() bool
	// GetShootHealthStatus returns this replica's shoot health status (healthy, progressing, or unhealthy).
	GetShootHealthStatus() gardenerutils.ShootStatus
	// IsDeletable returns true if this replica can be deleted, false otherwise. A replica can be deleted if it has no
	// scheduled shoots and is not protected by the "protect-from-deletion" annotation.
	IsDeletable() bool
	// CreateShoot initializes this replica's shoot and then creates it using the given context and client.
	CreateShoot(ctx context.Context, c client.Client, ordinal int) error
	// CreateManagedSeed initializes this replica's managed seed, and then creates it using the given context and client.
	CreateManagedSeed(ctx context.Context, c client.Client) error
	// DeleteShoot deletes this replica's shoot using the given context and client.
	DeleteShoot(ctx context.Context, c client.Client) error
	// DeleteManagedSeed deletes this replica's managed seed using the given context and client.
	DeleteManagedSeed(ctx context.Context, c client.Client) error
	// RetryShoot retries this replica's shoot using the given context and client.
	RetryShoot(ctx context.Context, c client.Client) error
}

Replica represents a ManagedSeedSet replica.

func NewReplica

func NewReplica(
	managedSeedSet *seedmanagementv1alpha1.ManagedSeedSet,
	shoot *gardencorev1beta1.Shoot,
	managedSeed *seedmanagementv1alpha1.ManagedSeed,
	seed *gardencorev1beta1.Seed,
	hasScheduledShoots bool,
) Replica

NewReplica creates and returns a new Replica with the given parameters.

type ReplicaFactory

type ReplicaFactory interface {
	// NewReplica creates and returns a new replica with the given parameters.
	NewReplica(*seedmanagementv1alpha1.ManagedSeedSet, *gardencorev1beta1.Shoot, *seedmanagementv1alpha1.ManagedSeed, *gardencorev1beta1.Seed, bool) Replica
}

ReplicaFactory provides a method for creating new replicas.

type ReplicaFactoryFunc

ReplicaFactoryFunc is a function that implements ReplicaFactory.

func (ReplicaFactoryFunc) NewReplica

func (f ReplicaFactoryFunc) NewReplica(
	managedSeedSet *seedmanagementv1alpha1.ManagedSeedSet,
	shoot *gardencorev1beta1.Shoot,
	managedSeed *seedmanagementv1alpha1.ManagedSeed,
	seed *gardencorev1beta1.Seed,
	hasScheduledShoots bool,
) Replica

NewReplica creates and returns a new Replica with the given parameters.

type ReplicaGetter

type ReplicaGetter interface {
	// GetReplicas gets and returns all existing replicas of the given set.
	GetReplicas(context.Context, *seedmanagementv1alpha1.ManagedSeedSet) ([]Replica, error)
}

ReplicaGetter provides a method for getting all existing replicas of a ManagedSeedSet.

func NewReplicaGetter

func NewReplicaGetter(client client.Client, apiReader client.Reader, replicaFactory ReplicaFactory) ReplicaGetter

NewReplicaGetter creates and returns a new ReplicaGetter with the given parameters.

type ReplicaStatus

type ReplicaStatus int

ReplicaStatus represents a creation / update / deletion status of a ManagedSeedSet replica. During replica creation / update, the status changes like this: x => ShootReconciling => ShootReconciled => ManagedSeedPreparing => ManagedSeedRegistered During replica deletion, the status changes like this: ManagedSeedRegistered => ManagedSeedDeleting => ShootReconciled => ShootDeleting => x If shoot reconciliation or deletion fails, the status can become also ShootReconcileFailed or ShootDeleteFailed. Upon retry, it will become ShootReconciling or ShootDeleting until it either succeeds or fails again. Note that we are only interested in the shoot reconciliation / deletion status if the managed seed doesn't exist (either not created yet or already deleted), or if it's on a lower revision than the shoot (during updates).

const (
	StatusUnknown               ReplicaStatus = iota // 0
	StatusShootReconcileFailed                       // 1
	StatusShootDeleteFailed                          // 2
	StatusShootReconciling                           // 3
	StatusShootDeleting                              // 4
	StatusShootReconciled                            // 5
	StatusManagedSeedPreparing                       // 6
	StatusManagedSeedDeleting                        // 7
	StatusManagedSeedRegistered                      // 8
)

Replica status constants

func (ReplicaStatus) String

func (rs ReplicaStatus) String() string

String returns a representation of this replica status as a string.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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