Skip to content

Commit

Permalink
Merge pull request #4406 from CecileRobertMichon/timeout-reconcile-co…
Browse files Browse the repository at this point in the history
…nfig

Make all reconcile timeouts configurable
  • Loading branch information
k8s-ci-robot authored Dec 21, 2023
2 parents 1845be1 + 04a7561 commit 2bfbdc9
Show file tree
Hide file tree
Showing 103 changed files with 1,842 additions and 247 deletions.
10 changes: 10 additions & 0 deletions azure/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package azure

import (
"context"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
Expand Down Expand Up @@ -101,6 +102,14 @@ type AsyncStatusUpdater interface {
UpdatePutStatus(clusterv1.ConditionType, string, error)
UpdateDeleteStatus(clusterv1.ConditionType, string, error)
UpdatePatchStatus(clusterv1.ConditionType, string, error)
AsyncReconciler
}

// AsyncReconciler is an interface used to get the default timeouts and requeue time for a reconciler that reconciles services asynchronously.
type AsyncReconciler interface {
DefaultedAzureCallTimeout() time.Duration
DefaultedAzureServiceReconcileTimeout() time.Duration
DefaultedReconcilerRequeue() time.Duration
}

// ClusterScoper combines the ClusterDescriber and NetworkDescriber interfaces.
Expand All @@ -116,6 +125,7 @@ type ClusterScoper interface {
type ManagedClusterScoper interface {
ClusterDescriber
NodeResourceGroup() string
AsyncReconciler
}

// ResourceSpecGetter is an interface for getting all the required information to create/update/delete an Azure resource.
Expand Down
192 changes: 192 additions & 0 deletions azure/mock_azure/azure_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions azure/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type ClusterScopeParams struct {
Cluster *clusterv1.Cluster
AzureCluster *infrav1.AzureCluster
Cache *ClusterCache
Timeouts azure.AsyncReconciler
}

// NewClusterScope creates a new Scope from the supplied parameters.
Expand Down Expand Up @@ -95,12 +96,13 @@ func NewClusterScope(ctx context.Context, params ClusterScopeParams) (*ClusterSc
}

return &ClusterScope{
Client: params.Client,
AzureClients: params.AzureClients,
Cluster: params.Cluster,
AzureCluster: params.AzureCluster,
patchHelper: helper,
cache: params.Cache,
Client: params.Client,
AzureClients: params.AzureClients,
Cluster: params.Cluster,
AzureCluster: params.AzureCluster,
patchHelper: helper,
cache: params.Cache,
AsyncReconciler: params.Timeouts,
}, nil
}

Expand All @@ -113,6 +115,7 @@ type ClusterScope struct {
AzureClients
Cluster *clusterv1.Cluster
AzureCluster *infrav1.AzureCluster
azure.AsyncReconciler
}

// ClusterCache stores ClusterCache data locally so we don't have to hit the API multiple times within the same reconcile loop.
Expand Down
3 changes: 3 additions & 0 deletions azure/scope/managedcontrolplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type ManagedControlPlaneScopeParams struct {
ControlPlane *infrav1.AzureManagedControlPlane
ManagedMachinePools []ManagedMachinePool
Cache *ManagedControlPlaneCache
Timeouts azure.AsyncReconciler
}

// NewManagedControlPlaneScope creates a new Scope from the supplied parameters.
Expand Down Expand Up @@ -111,6 +112,7 @@ func NewManagedControlPlaneScope(ctx context.Context, params ManagedControlPlane
ManagedMachinePools: params.ManagedMachinePools,
PatchHelper: helper,
cache: params.Cache,
AsyncReconciler: params.Timeouts,
}, nil
}

Expand All @@ -126,6 +128,7 @@ type ManagedControlPlaneScope struct {
Cluster *clusterv1.Cluster
ControlPlane *infrav1.AzureManagedControlPlane
ManagedMachinePools []ManagedMachinePool
azure.AsyncReconciler
}

// ManagedControlPlaneCache stores ManagedControlPlane data locally so we don't have to hit the API multiple times within the same reconcile loop.
Expand Down
43 changes: 43 additions & 0 deletions azure/services/agentpools/mock_agentpools/agentpools_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2bfbdc9

Please sign in to comment.