Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEventLogValues(event event.CreateEvent) []interface{}
- func CreateEventLogger(log logr.Logger, event event.CreateEvent) logr.Logger
- func DeleteAllFinalizers(ctx context.Context, client 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 GenericEventLogValues(event event.GenericEvent) []interface{}
- func GenericEventLogger(log logr.Logger, event event.GenericEvent) logr.Logger
- func GetControlPlaneReplicas(cluster *Cluster, scaledDown bool, wokenUp int) int
- func GetObjectByReference(ctx context.Context, c client.Client, ...) error
- func GetPodNetwork(cluster *Cluster) string
- func GetReplicas(cluster *Cluster, wokenUp int) int
- func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
- func GetServiceNetwork(cluster *Cluster) string
- func GetVerticalPodAutoscalerObject() *unstructured.Unstructured
- func HasFinalizer(obj runtime.Object, finalizerName string) (bool, error)
- func IsFailed(cluster *Cluster) bool
- func IsHibernated(cluster *Cluster) bool
- func IsMigrated(obj runtime.Object) bool
- func IsShootFailed(shoot *gardencorev1beta1.Shoot) bool
- func IsUnmanagedDNSProvider(cluster *Cluster) bool
- func LastError(description string, codes ...gardencorev1beta1.ErrorCode) *gardencorev1beta1.LastError
- func LastOperation(t gardencorev1beta1.LastOperationType, ...) *gardencorev1beta1.LastOperation
- func MetaObjectLogValues(obj metav1.Object) []interface{}
- func OperationAnnotationWrapper(objectType runtime.Object, reconciler reconcile.Reconciler) reconcile.Reconciler
- 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 gardencorev1beta1.LastOperationType, description string, progress int32, ...) (*gardencorev1beta1.LastOperation, *gardencorev1beta1.LastError)
- func ReconcileSucceeded(t gardencorev1beta1.LastOperationType, description string) (*gardencorev1beta1.LastOperation, *gardencorev1beta1.LastError)
- func RemoveAnnotation(ctx context.Context, c client.Client, obj runtime.Object, annotation string) error
- func RenderChartAndCreateManagedResource(ctx context.Context, namespace string, name string, client client.Client, ...) error
- func RuntimeObjectLogValues(obj runtime.Object) []interface{}
- func SecretReferenceToKey(ref *corev1.SecretReference) client.ObjectKey
- func SetupSignalHandlerContext() context.Context
- 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 ChartRendererFactory
- type ChartRendererFactoryFunc
- type Cluster
- type WatchBuilder
Constants ¶
const ( // ShootNoCleanupLabel is a constant for a label on a resource indicating the the Gardener cleaner should not delete this // resource when cleaning a shoot during the deletion flow. ShootNoCleanupLabel = "shoot.gardener.cloud/no-cleanup" )
Variables ¶
var ( // NewGardenDecoder returns a new Garden API decoder. NewGardenDecoder = extensions.NewGardenDecoder // GetCluster tries to read Gardener's Cluster extension resource in the given namespace. GetCluster = extensions.GetCluster // CloudProfileFromCluster returns the CloudProfile resource inside the Cluster resource. CloudProfileFromCluster = extensions.CloudProfileFromCluster // SeedFromCluster returns the Seed resource inside the Cluster resource. SeedFromCluster = extensions.SeedFromCluster // ShootFromCluster returns the Shoot resource inside the Cluster resource. ShootFromCluster = extensions.ShootFromCluster // GetShoot tries to read Gardener's Cluster extension resource in the given namespace and return the embedded Shoot resource. GetShoot = extensions.GetShoot )
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 TryPatch = kutil.TryPatch
TryPatch tries to apply the given transformation function onto the given object, and to patch it afterwards with optimistic locking. It retries the patch with an exponential backoff.
var TryPatchStatus = kutil.TryPatchStatus
TryPatchStatus tries to apply the given transformation function onto the given object, and to patch its status afterwards with optimistic locking. It retries the status patch with an exponential backoff.
var TryUpdate = kutil.TryUpdate
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.
var TryUpdateStatus = kutil.TryUpdateStatus
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.
Functions ¶
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 DeleteAllFinalizers ¶
DeleteAllFinalizers removes all finalizers from the object and issues an update.
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 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 ¶
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 GetObjectByReference ¶ added in v1.6.0
func GetObjectByReference(ctx context.Context, c client.Client, ref *autoscalingv1.CrossVersionObjectReference, namespace string, obj runtime.Object) error
GetObjectByReference gets an object by the given reference, in the given namespace. If the object kind doesn't match the given reference kind this will result in an error.
func GetPodNetwork ¶
GetPodNetwork returns the pod network CIDR of the given Shoot.
func GetReplicas ¶
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 GetServiceNetwork ¶
GetServiceNetwork returns the service network CIDR of the given Shoot.
func GetVerticalPodAutoscalerObject ¶
func GetVerticalPodAutoscalerObject() *unstructured.Unstructured
GetVerticalPodAutoscalerObject returns unstructured.Unstructured representing autoscalingv1beta2.VerticalPodAutoscaler
func HasFinalizer ¶
HasFinalizer checks if the given object has a finalizer with the given name.
func IsFailed ¶ added in v1.5.0
IsFailed returns true if the embedded shoot is failed, or false otherwise.
func IsHibernated ¶
IsHibernated returns true if the shoot is hibernated, or false otherwise.
func IsMigrated ¶ added in v1.4.0
IsMigrated checks if an extension object has been migrated
func IsShootFailed ¶ added in v1.5.0
func IsShootFailed(shoot *gardencorev1beta1.Shoot) bool
IsShootFailed returns true if the shoot is failed, or false otherwise.
func IsUnmanagedDNSProvider ¶
IsUnmanagedDNSProvider returns true if the shoot uses an unmanaged DNS provider.
func LastError ¶
func LastError(description string, codes ...gardencorev1beta1.ErrorCode) *gardencorev1beta1.LastError
LastError creates a new LastError from the given parameters.
func LastOperation ¶
func LastOperation(t gardencorev1beta1.LastOperationType, state gardencorev1beta1.LastOperationState, progress int32, description string) *gardencorev1beta1.LastOperation
LastOperation creates a new LastOperation from the given parameters.
func MetaObjectLogValues ¶
MetaObjectLogValues extracts the log values from the given metav1.Object.
func OperationAnnotationWrapper ¶
func OperationAnnotationWrapper(objectType runtime.Object, reconciler reconcile.Reconciler) reconcile.Reconciler
OperationAnnotationWrapper is a wrapper for an reconciler that removes the Gardener operation annotation before `Reconcile` is called.
This is useful in conjunction with the HasOperationAnnotationPredicate.
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 gardencorev1beta1.LastOperationType, description string, progress int32, codes ...gardencorev1beta1.ErrorCode) (*gardencorev1beta1.LastOperation, *gardencorev1beta1.LastError)
ReconcileError returns a LastOperation with state error and a LastError with the given description and codes.
func ReconcileSucceeded ¶
func ReconcileSucceeded(t gardencorev1beta1.LastOperationType, description string) (*gardencorev1beta1.LastOperation, *gardencorev1beta1.LastError)
ReconcileSucceeded returns a LastOperation with state succeeded at 100 percent and a nil LastError.
func RemoveAnnotation ¶ added in v1.4.0
func RemoveAnnotation(ctx context.Context, c client.Client, obj runtime.Object, annotation string) error
RemoveAnnotation removes an annotation key passed as annotation
func RenderChartAndCreateManagedResource ¶
func RenderChartAndCreateManagedResource(ctx context.Context, namespace string, name string, client client.Client, chartRenderer chartrenderer.Interface, chart chart.Interface, values map[string]interface{}, imageVector imagevector.ImageVector, chartNamespace string, version string, withNoCleanupLabel bool, forceOverwriteAnnotations bool) error
RenderChartAndCreateManagedResource renders a chart and creates a ManagedResource for the gardener-resource-manager out of the results.
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 SetupSignalHandlerContext ¶
SetupSignalHandlerContext sets up a context from signals.SetupSignalHandler stop channel.
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 ChartRendererFactory ¶
type ChartRendererFactory interface { // NewChartRendererForShoot creates a new chartrenderer.Interface for the shoot cluster. NewChartRendererForShoot(string) (chartrenderer.Interface, error) }
ChartRendererFactory creates chartrenderer.Interface to be used by this actuator.
type ChartRendererFactoryFunc ¶
type ChartRendererFactoryFunc func(string) (chartrenderer.Interface, error)
ChartRendererFactoryFunc is a function that satisfies ChartRendererFactory.
func (ChartRendererFactoryFunc) NewChartRendererForShoot ¶
func (f ChartRendererFactoryFunc) NewChartRendererForShoot(version string) (chartrenderer.Interface, error)
NewChartRendererForShoot creates a new chartrenderer.Interface for the shoot cluster.
type Cluster ¶
type Cluster = extensions.Cluster
Cluster contains the decoded resources of Gardener's extension Cluster resource.
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.