From 4ad34136ec6ebe7836ac28ee4167bb05962c5638 Mon Sep 17 00:00:00 2001 From: Johannes Scheerer Date: Mon, 30 Oct 2023 15:29:32 +0100 Subject: [PATCH] Fix reconciliation of hibernated clusters. In the past, the extension library utilized a lazy kubernetes client instantiation. However, this changed recently with gardener v1.80 and its controller-runtime update. Now, the kubernetes client creation will fail if the api-server is not available. In case a shoot cluster is hibernated, the api-server is not available. Hence, the reconciliation will run into a corresponding error. This was handled previously by discarding the error returned from the GET call. Now, we check first if the cluster is hibernated and only create the client if it is not. --- pkg/controller/actuator_reconcile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/actuator_reconcile.go b/pkg/controller/actuator_reconcile.go index b7943d94f..7505a72fe 100644 --- a/pkg/controller/actuator_reconcile.go +++ b/pkg/controller/actuator_reconcile.go @@ -159,6 +159,10 @@ func (a *actuator) Reconcile(ctx context.Context, _ logr.Logger, network *extens } func getCiliumConfigMap(ctx context.Context, cl client.Client, cluster *extensionscontroller.Cluster) (*corev1.ConfigMap, error) { + // Cannot retrieve config map of hibernated clusters => use empty config map instead + if extensionscontroller.IsHibernated(cluster) { + return &corev1.ConfigMap{}, nil + } _, shootClient, err := util.NewClientForShoot(ctx, cl, cluster.ObjectMeta.Name, client.Options{}, extensionsconfig.RESTOptions{}) if err != nil { return nil, fmt.Errorf("could not create shoot client: %w", err)