-
Notifications
You must be signed in to change notification settings - Fork 458
/
types.go
28 lines (21 loc) · 1.13 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
package care
import (
"context"
"time"
"k8s.io/utils/clock"
"sigs.k8s.io/controller-runtime/pkg/client"
gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
)
// NewHealthCheckFunc is a function used to create a new instance for performing health checks.
type NewHealthCheckFunc func(*gardencorev1beta1.Seed, client.Client, clock.Clock, *string, map[gardencorev1beta1.ConditionType]time.Duration) HealthCheck
// defaultNewHealthCheck is the default function to create a new instance for performing health checks.
var defaultNewHealthCheck NewHealthCheckFunc = func(seed *gardencorev1beta1.Seed, client client.Client, clock clock.Clock, namespace *string, conditionThresholds map[gardencorev1beta1.ConditionType]time.Duration) HealthCheck {
return NewHealth(seed, client, clock, namespace, conditionThresholds)
}
// HealthCheck is an interface used to perform health checks.
type HealthCheck interface {
Check(ctx context.Context, condition SeedConditions) []gardencorev1beta1.Condition
}