mirror of
https://github.com/ysoftdevs/gardener-extension-shoot-fleet-agent.git
synced 2026-03-18 07:14:13 +01:00
Fix reconciliation of fleet pre-token requestor
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
|
||||
Copyright (c) SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
|
||||
Copyright (c) SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -108,6 +108,11 @@ func (a *actuator) ensureDependencies(ctx context.Context, cluster *extensions.C
|
||||
return utils.RunParallelFunctions(dependencyFunctions)
|
||||
}
|
||||
|
||||
// isShootedSeed looks into the Cluster object to determine whether we are in a Shooted Seed cluster
|
||||
func isShootHibernated(cluster *extensions.Cluster) bool {
|
||||
return cluster.Shoot.Status.IsHibernated
|
||||
}
|
||||
|
||||
// Reconcile the Extension resource.
|
||||
func (a *actuator) Reconcile(ctx context.Context, ex *extensionsv1alpha1.Extension) error {
|
||||
namespace := ex.GetNamespace()
|
||||
@@ -119,6 +124,10 @@ func (a *actuator) Reconcile(ctx context.Context, ex *extensionsv1alpha1.Extensi
|
||||
if isShootedSeedCluster(cluster) {
|
||||
return a.updateStatus(ctx, ex)
|
||||
}
|
||||
if isShootHibernated(cluster) {
|
||||
return a.updateStatus(ctx, ex)
|
||||
}
|
||||
|
||||
shootsConfigOverride := &config.Config{}
|
||||
if ex.Spec.ProviderConfig != nil { //parse providerConfig defaults override for this Shoot
|
||||
if _, _, err := a.decoder.Decode(ex.Spec.ProviderConfig.Raw, nil, shootsConfigOverride); err != nil {
|
||||
@@ -195,7 +204,7 @@ func (a *actuator) InjectScheme(scheme *runtime.Scheme) error {
|
||||
func (a *actuator) ReconcileClusterInFleetManager(ctx context.Context, namespace string, cluster *extensions.Cluster, override *config.Config) error {
|
||||
a.logger.Info("Starting with already registered check")
|
||||
labels := prepareLabels(cluster, getProjectConfig(cluster, &a.serviceConfig), getProjectConfig(cluster, override))
|
||||
registered, err := a.getFleetManager(cluster).GetCluster(ctx, cluster.Shoot.Name)
|
||||
registered, err := a.getFleetManager(cluster).GetCluster(ctx, buildCrdName(cluster))
|
||||
|
||||
// We cannot find the cluster because of an unknown error
|
||||
if err != nil && !errors.IsNotFound(err) {
|
||||
|
||||
Reference in New Issue
Block a user