From ebefeb3277431f4dc530154abf76baf2d5196879 Mon Sep 17 00:00:00 2001 From: Maximilian Geberl <48486938+dergeberl@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:38:34 +0200 Subject: [PATCH] Remove ControlPlane healthchecks (#52) --- pkg/controller/healthcheck/add.go | 40 ++----------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/pkg/controller/healthcheck/add.go b/pkg/controller/healthcheck/add.go index 0f7be802e..95f814f83 100644 --- a/pkg/controller/healthcheck/add.go +++ b/pkg/controller/healthcheck/add.go @@ -18,11 +18,11 @@ import ( "context" "time" + "github.com/gardener/gardener-extension-provider-openstack/pkg/apis/openstack/helper" + "github.com/gardener/gardener-extension-provider-openstack/pkg/openstack" healthcheckconfig "github.com/gardener/gardener/extensions/pkg/apis/config" "github.com/gardener/gardener/extensions/pkg/controller/healthcheck" - "github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general" "github.com/gardener/gardener/extensions/pkg/controller/healthcheck/worker" - extensionspredicate "github.com/gardener/gardener/extensions/pkg/predicate" "github.com/gardener/gardener/extensions/pkg/util" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" @@ -31,10 +31,6 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/predicate" - - "github.com/gardener/gardener-extension-provider-openstack/pkg/apis/openstack/helper" - "github.com/gardener/gardener-extension-provider-openstack/pkg/openstack" ) var ( @@ -54,38 +50,6 @@ var ( // RegisterHealthChecks registers health checks for each extension resource // HealthChecks are grouped by extension (e.g worker), extension.type (e.g aws) and Health Check Type (e.g ShootControlPlaneHealthy) func RegisterHealthChecks(ctx context.Context, mgr manager.Manager, opts healthcheck.DefaultAddArgs) error { - if err := healthcheck.DefaultRegistration( - ctx, - openstack.Type, - extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.ControlPlaneResource), - func() client.ObjectList { return &extensionsv1alpha1.ControlPlaneList{} }, - func() extensionsv1alpha1.Object { return &extensionsv1alpha1.ControlPlane{} }, - mgr, - opts, - []predicate.Predicate{extensionspredicate.HasPurpose(extensionsv1alpha1.Normal)}, - []healthcheck.ConditionTypeToHealthCheck{ - { - ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(openstack.CloudControllerManagerName), - }, - { - ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(openstack.CSIControllerName), - }, - { - ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(openstack.CSISnapshotControllerName), - }, - { - ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(openstack.CSISnapshotValidationName), - }, - }, - sets.New[gardencorev1beta1.ConditionType](), - ); err != nil { - return err - } - return healthcheck.DefaultRegistration( ctx, openstack.Type,