Skip to content

Commit

Permalink
Improve PreCheckFunc function signature (#5509)
Browse files Browse the repository at this point in the history
  • Loading branch information
acumino committed Mar 3, 2022
1 parent 9b8deb2 commit ab23368
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extensions/pkg/controller/healthcheck/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type GetExtensionObjectFunc = func() extensionsv1alpha1.Object
type GetExtensionObjectListFunc = func() client.ObjectList

// PreCheckFunc checks whether the health check shall be performed based on the given object and cluster.
type PreCheckFunc = func(client.Object, *extensionscontroller.Cluster) bool
type PreCheckFunc = func(context.Context, client.Client, client.Object, *extensionscontroller.Cluster) bool

// ConditionTypeToHealthCheck registers a HealthCheck for the given ConditionType. If the PreCheckFunc is not nil it will
// be executed with the given object before the health check if performed. Otherwise, the health check will always be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (a *Actuator) ExecuteHealthCheckFunctions(ctx context.Context, request type
return
}

if !preCheckFunc(obj, cluster) {
if !preCheckFunc(ctx, a.seedClient, obj, cluster) {
a.logger.V(6).Info("Skipping health check as pre check function returned false", "conditionType", healthConditionType)
channel <- channelResult{
healthCheckResult: &SingleCheckResult{
Expand Down

0 comments on commit ab23368

Please sign in to comment.