Skip to content

Commit

Permalink
Removes owner checks from extension controller reconciliations (garde…
Browse files Browse the repository at this point in the history
…ner#6973)

* Removes owner checks from extension reconcilatiations

* Removes unused owner check code
  • Loading branch information
plkokanov authored Nov 14, 2022
1 parent 52b4a5e commit 46d9687
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 1,884 deletions.
15 changes: 0 additions & 15 deletions extensions/pkg/controller/backupentry/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"

extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller"
"github.com/gardener/gardener/extensions/pkg/controller/common"
gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
gardencorev1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper"
Expand Down Expand Up @@ -99,20 +98,6 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) (

operationType := gardencorev1beta1helper.ComputeOperationType(be.ObjectMeta, be.Status.LastOperation)

if cluster != nil && cluster.Shoot != nil && operationType != gardencorev1beta1.LastOperationTypeMigrate {
key := "backupentry:" + be.Name
ok, watchdogCtx, cleanup, err := common.GetOwnerCheckResultAndContext(ctx, r.client, shootTechnicalID, cluster.Shoot.Name, key)
if err != nil {
return reconcile.Result{}, err
} else if !ok {
return reconcile.Result{}, fmt.Errorf("this seed is not the owner of shoot %s", kutil.ObjectName(cluster.Shoot))
}
ctx = watchdogCtx
if cleanup != nil {
defer cleanup()
}
}

switch {
case extensionscontroller.ShouldSkipOperation(operationType, be):
return reconcile.Result{}, nil
Expand Down
2 changes: 0 additions & 2 deletions extensions/pkg/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ var (
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
// GetOwnerNameAndID reads the owner DNS name and ID from the owner DNSRecord extension resource in the given namespace.
GetOwnerNameAndID = extensions.GetOwnerNameAndID
// GenericTokenKubeconfigSecretNameFromCluster reads the generic-token-kubeconfig.secret.gardener.cloud/name annotation
// and returns its value. If the annotation is not present then it falls back to the deprecated
// SecretNameGenericTokenKubeconfig.
Expand Down
195 changes: 0 additions & 195 deletions extensions/pkg/controller/common/checkerwatchdog.go

This file was deleted.

165 changes: 0 additions & 165 deletions extensions/pkg/controller/common/checkerwatchdog_test.go

This file was deleted.

Loading

0 comments on commit 46d9687

Please sign in to comment.