Documentation ¶
Index ¶
- Variables
- func AnnotationsChangedPredicate() predicate.Predicate
- func CloudProfileFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.CloudProfile, error)
- func CloudProfileGenerationUpdatePredicate() predicate.Predicate
- func ClusterToObjectMapper(client client.Client, newObjListFunc func() runtime.Object, ...) handler.Mapper
- func CreateEventLogValues(event event.CreateEvent) []interface{}
- func CreateEventLogger(log logr.Logger, event event.CreateEvent) logr.Logger
- func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, ...) error
- func DeleteEventLogValues(event event.DeleteEvent) []interface{}
- func DeleteEventLogger(log logr.Logger, event event.DeleteEvent) logr.Logger
- func DeleteFinalizer(ctx context.Context, client client.Client, finalizerName string, ...) error
- func EnsureFinalizer(ctx context.Context, client client.Client, finalizerName string, ...) error
- func EvalGenericPredicate(obj runtime.Object, predicates ...predicate.Predicate) bool
- func GenerationChangedPredicate() predicate.Predicate
- func GenericEventLogValues(event event.GenericEvent) []interface{}
- func GenericEventLogger(log logr.Logger, event event.GenericEvent) logr.Logger
- func GetControlPlaneReplicas(shoot *gardenv1beta1.Shoot, scaledDown bool, wokenUp int) int
- func GetPodNetwork(shoot *gardenv1beta1.Shoot) gardencorev1alpha1.CIDR
- func GetReplicas(shoot *gardenv1beta1.Shoot, wokenUp int) int
- func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
- func HasFinalizer(obj runtime.Object, finalizerName string) (bool, error)
- func IsHibernated(shoot *gardenv1beta1.Shoot) bool
- func LastError(description string, codes ...gardencorev1alpha1.ErrorCode) *gardencorev1alpha1.LastError
- func LastOperation(t gardencorev1alpha1.LastOperationType, ...) *gardencorev1alpha1.LastOperation
- func MapperWithinNamespace(cl client.Client, newObjListFunc func() runtime.Object, ...) handler.ToRequestsFunc
- func MetaObjectLogValues(obj metav1.Object) []interface{}
- func NamePredicate(name string) predicate.Predicate
- func NewGenericEvent(meta metav1.Object, obj runtime.Object) event.GenericEvent
- func NewGenericEventFromObject(obj runtime.Object) event.GenericEvent
- func OrPredicate(predicates ...predicate.Predicate) predicate.Predicate
- func PrefixLogValues(prefix string, logValues []interface{}) []interface{}
- func ReconcileErr(err error) (reconcile.Result, error)
- func ReconcileErrCause(err error) error
- func ReconcileErrCauseOrErr(err error) error
- func ReconcileError(t gardencorev1alpha1.LastOperationType, description string, progress int, ...) (*gardencorev1alpha1.LastOperation, *gardencorev1alpha1.LastError)
- func ReconcileSucceeded(t gardencorev1alpha1.LastOperationType, description string) (*gardencorev1alpha1.LastOperation, *gardencorev1alpha1.LastError)
- func RuntimeObjectLogValues(obj runtime.Object) []interface{}
- func SecretReferenceToKey(ref *corev1.SecretReference) client.ObjectKey
- func SeedFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.Seed, error)
- func SetupSignalHandlerContext() context.Context
- func ShootFailedPredicate(c client.Client) predicate.Predicate
- func ShootFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.Shoot, error)
- func ShootGenerationUpdatedPredicate() predicate.Predicate
- func ShootIsFailed(shoot *gardenv1beta1.Shoot) bool
- func TryUpdate(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, ...) error
- func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, ...) error
- func TypePredicate(typeName string) predicate.Predicate
- func UnsafeGuessKind(obj runtime.Object) string
- func UpdateEventLogValues(event event.UpdateEvent) []interface{}
- func UpdateEventLogger(log logr.Logger, event event.UpdateEvent) logr.Logger
- type AddToManagerBuilder
- type Cluster
- type WatchBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // AddToScheme adds the Kubernetes and extension scheme to the given scheme. AddToScheme = localSchemeBuilder.AddToScheme // ExtensionsScheme is the default scheme for extensions, consisting of all Kubernetes built-in // schemes (client-go/kubernetes/scheme) and the extensions/v1alpha1 scheme. ExtensionsScheme = runtime.NewScheme() )
var PredicateLog logr.Logger = log.Log
PredicateLog is the logger for predicates.
Functions ¶
func AnnotationsChangedPredicate ¶
AnnotationsChangedPredicate is a predicate for annotations changes.
func CloudProfileFromCluster ¶
func CloudProfileFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.CloudProfile, error)
CloudProfileFromCluster returns the CloudProfile resource inside the Cluster resource.
func CloudProfileGenerationUpdatePredicate ¶
CloudProfileGenerationUpdatePredicate is a predicate for generation updates of cloud profiles.
func ClusterToObjectMapper ¶
func ClusterToObjectMapper(client client.Client, newObjListFunc func() runtime.Object, predicates []predicate.Predicate) handler.Mapper
ClusterToObjectMapper returns a mapper that returns requests for objects whose referenced clusters have been modified.
func CreateEventLogValues ¶
func CreateEventLogValues(event event.CreateEvent) []interface{}
CreateEventLogValues extracts the log values from the given CreateEvent.
func CreateEventLogger ¶
CreateEventLogger creates a Logger with keys and values from the given CreateEvent.
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, transform func() error) error
CreateOrUpdate creates or updates the object. Optionally, it executes a transformation function before the request is made.
func DeleteEventLogValues ¶
func DeleteEventLogValues(event event.DeleteEvent) []interface{}
DeleteEventLogValues extracts the log values from the given DeleteEvent.
func DeleteEventLogger ¶
DeleteEventLogger creates a Logger with keys and values from the given DeleteEvent.
func DeleteFinalizer ¶
func DeleteFinalizer(ctx context.Context, client client.Client, finalizerName string, obj runtime.Object) error
DeleteFinalizer ensures that the given finalizer is not present anymore in the given object. If it is set, it removes it and issues an update.
func EnsureFinalizer ¶
func EnsureFinalizer(ctx context.Context, client client.Client, finalizerName string, obj runtime.Object) error
EnsureFinalizer ensures that a finalizer of the given name is set on the given object. If the finalizer is not set, it adds it to the list of finalizers and updates the remote object.
func EvalGenericPredicate ¶
EvalGenericPredicate returns true if all predicates match for the given object.
func GenerationChangedPredicate ¶
GenerationChangedPredicate is a predicate for generation changes.
func GenericEventLogValues ¶
func GenericEventLogValues(event event.GenericEvent) []interface{}
GenericEventLogValues extracts the log values from the given GenericEvent.
func GenericEventLogger ¶
GenericEventLogger creates a Logger with keys and values from the given GenericEvent.
func GetControlPlaneReplicas ¶
func GetControlPlaneReplicas(shoot *gardenv1beta1.Shoot, scaledDown bool, wokenUp int) int
GetControlPlaneReplicas returns the woken up replicas for controlplane components of the given Shoot that should only be scaled down at the end of the flow.
func GetPodNetwork ¶
func GetPodNetwork(shoot *gardenv1beta1.Shoot) gardencorev1alpha1.CIDR
GetPodNetwork returns the pod network CIDR of the given Shoot.
func GetReplicas ¶
func GetReplicas(shoot *gardenv1beta1.Shoot, wokenUp int) int
GetReplicas returns the woken up replicas of the given Shoot.
func GetSecretByReference ¶
func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
GetSecretByReference returns the Secret object matching the given SecretReference.
func HasFinalizer ¶
HasFinalizer checks if the given object has a finalizer with the given name.
func IsHibernated ¶
func IsHibernated(shoot *gardenv1beta1.Shoot) bool
IsHibernated returns true if the shoot is hibernated, or false otherwise.
func LastError ¶
func LastError(description string, codes ...gardencorev1alpha1.ErrorCode) *gardencorev1alpha1.LastError
LastError creates a new LastError from the given parameters.
func LastOperation ¶
func LastOperation(t gardencorev1alpha1.LastOperationType, state gardencorev1alpha1.LastOperationState, progress int, description string) *gardencorev1alpha1.LastOperation
LastOperation creates a new LastOperation from the given parameters.
func MapperWithinNamespace ¶
func MapperWithinNamespace(cl client.Client, newObjListFunc func() runtime.Object, predicates []predicate.Predicate) handler.ToRequestsFunc
MapperWithinNamespace returns a `ToRequestsFunc` that maps objects within the same namespace as the given MapObject.
func MetaObjectLogValues ¶
MetaObjectLogValues extracts the log values from the given metav1.Object.
func NamePredicate ¶
NamePredicate returns a predicate that matches the given name of a resource.
func NewGenericEvent ¶
NewGenericEvent creates a new GenericEvent from the given metav1.Object and runtime.Object.
func NewGenericEventFromObject ¶
func NewGenericEventFromObject(obj runtime.Object) event.GenericEvent
NewGenericEventFromObject creates a new GenericEvent from the given runtime.Object.
It tries to extract a metav1.Object from the given Object. If it fails, the Meta of the resulting GenericEvent will be `nil`.
func OrPredicate ¶
OrPredicate builds a logical OR gate of passed predicates.
func PrefixLogValues ¶
func PrefixLogValues(prefix string, logValues []interface{}) []interface{}
PrefixLogValues prefixes the keys of the given logValues with the given prefix.
func ReconcileErr ¶
ReconcileErr returns a reconcile.Result or an error, depending on whether the error is a RequeueAfterError or not.
func ReconcileErrCause ¶
ReconcileErrCause returns the cause in case the error is an RequeueAfterError. Otherwise, it returns the input error.
func ReconcileErrCauseOrErr ¶
ReconcileErrCauseOrErr returns the cause of the error or the error if the cause is nil.
func ReconcileError ¶
func ReconcileError(t gardencorev1alpha1.LastOperationType, description string, progress int, codes ...gardencorev1alpha1.ErrorCode) (*gardencorev1alpha1.LastOperation, *gardencorev1alpha1.LastError)
ReconcileError returns a LastOperation with state error and a LastError with the given description and codes.
func ReconcileSucceeded ¶
func ReconcileSucceeded(t gardencorev1alpha1.LastOperationType, description string) (*gardencorev1alpha1.LastOperation, *gardencorev1alpha1.LastError)
ReconcileSucceeded returns a LastOperation with state succeeded at 100 percent and a nil LastError.
func RuntimeObjectLogValues ¶
RuntimeObjectLogValues extracts the log values from the given runtime.Object.
func SecretReferenceToKey ¶
func SecretReferenceToKey(ref *corev1.SecretReference) client.ObjectKey
SecretReferenceToKey returns the key of the given SecretReference.
func SeedFromCluster ¶
func SeedFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.Seed, error)
SeedFromCluster returns the Seed resource inside the Cluster resource.
func SetupSignalHandlerContext ¶
SetupSignalHandlerContext sets up a context from signals.SetupSignalHandler stop channel.
func ShootFailedPredicate ¶
ShootFailedPredicate is a predicate for failed shoots.
func ShootFromCluster ¶
func ShootFromCluster(cluster *extensionsv1alpha1.Cluster) (*gardenv1beta1.Shoot, error)
ShootFromCluster returns the Shoot resource inside the Cluster resource.
func ShootGenerationUpdatedPredicate ¶
ShootGenerationUpdatedPredicate is a predicate for generation updates of shoots.
func ShootIsFailed ¶
func ShootIsFailed(shoot *gardenv1beta1.Shoot) bool
ShootIsFailed returns whether the given shoot is marked as 'failed'.
func TryUpdate ¶
func TryUpdate(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, transform func() error) error
TryUpdate tries to apply the given transformation function onto the given object, and to update it afterwards. It retries the update with an exponential backoff.
func TryUpdateStatus ¶
func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, transform func() error) error
TryUpdateStatus tries to apply the given transformation function onto the given object, and to update its status afterwards. It retries the status update with an exponential backoff.
func TypePredicate ¶
TypePredicate filters the incoming OperatingSystemConfigs for ones that have the same type as the given type.
func UnsafeGuessKind ¶
UnsafeGuessKind makes an unsafe guess what is the kind of the given object.
The argument to this method _has_ to be a pointer, otherwise it panics.
func UpdateEventLogValues ¶
func UpdateEventLogValues(event event.UpdateEvent) []interface{}
UpdateEventLogValues extracts the log values from the given UpdateEvent.
func UpdateEventLogger ¶
UpdateEventLogger creates a Logger with keys and values from the given UpdateEvent.
Types ¶
type AddToManagerBuilder ¶
AddToManagerBuilder aggregates various AddToManager functions.
func NewAddToManagerBuilder ¶
func NewAddToManagerBuilder(funcs ...func(manager.Manager) error) AddToManagerBuilder
NewAddToManagerBuilder creates a new AddToManagerBuilder and registers the given functions.
func (*AddToManagerBuilder) AddToManager ¶
func (a *AddToManagerBuilder) AddToManager(m manager.Manager) error
AddToManager traverses over all AddToManager-functions of this builder, sequentially applying them. It exits on the first error and returns it.
type Cluster ¶
type Cluster struct { CloudProfile *gardenv1beta1.CloudProfile Seed *gardenv1beta1.Seed Shoot *gardenv1beta1.Shoot }
Cluster contains the decoded resources of Gardener's extension Cluster resource. TODO: Change from `gardenv1beta1` to `gardencorev1alpha1` once we have moved the resources there.
type WatchBuilder ¶
type WatchBuilder []func(controller.Controller) error
WatchBuilder holds various functions which add watch controls to the passed Controller.
func NewWatchBuilder ¶
func NewWatchBuilder(funcs ...func(controller.Controller) error) WatchBuilder
NewWatchBuilder creates a new WatchBuilder and registers the given functions.
func (*WatchBuilder) AddToController ¶
func (w *WatchBuilder) AddToController(ctrl controller.Controller) error
AddToController adds the registered watches to the passed controller.
func (*WatchBuilder) Register ¶
func (w *WatchBuilder) Register(funcs ...func(controller.Controller) error)
Register adds a function which add watch controls to the passed Controller to the WatchBuilder.