Skip to content

Commit

Permalink
Fix reconciliation of hibernated clusters. (#226)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ScheererJ authored Oct 30, 2023
1 parent 3a71b05 commit b072476
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/actuator_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b072476

Please sign in to comment.