@@ -24,17 +24,19 @@ import (
24
24
"fmt"
25
25
"io"
26
26
"net/url"
27
+ "runtime"
27
28
"strings"
28
29
29
30
corev1 "k8s.io/api/core/v1"
30
31
apierrors "k8s.io/apimachinery/pkg/api/errors"
31
32
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32
- "k8s.io/apimachinery/pkg/runtime"
33
+ k8sruntime "k8s.io/apimachinery/pkg/runtime"
33
34
"k8s.io/apimachinery/pkg/types"
34
35
"k8s.io/client-go/tools/record"
35
36
ctrl "sigs.k8s.io/controller-runtime"
36
37
"sigs.k8s.io/controller-runtime/pkg/builder"
37
38
"sigs.k8s.io/controller-runtime/pkg/client"
39
+ "sigs.k8s.io/controller-runtime/pkg/controller"
38
40
"sigs.k8s.io/controller-runtime/pkg/predicate"
39
41
40
42
"ariga.io/atlas-go-sdk/atlasexec"
53
55
// AtlasMigrationReconciler reconciles a AtlasMigration object
54
56
AtlasMigrationReconciler struct {
55
57
client.Client
56
- scheme * runtime .Scheme
58
+ scheme * k8sruntime .Scheme
57
59
atlasClient AtlasExecFn
58
60
configMapWatcher * watch.ResourceWatcher
59
61
secretWatcher * watch.ResourceWatcher
@@ -200,6 +202,9 @@ func (r *AtlasMigrationReconciler) storeDirState(ctx context.Context, obj client
200
202
// SetupWithManager sets up the controller with the Manager.
201
203
func (r * AtlasMigrationReconciler ) SetupWithManager (mgr ctrl.Manager ) error {
202
204
return ctrl .NewControllerManagedBy (mgr ).
205
+ WithOptions (controller.Options {
206
+ MaxConcurrentReconciles : runtime .NumCPU (),
207
+ }).
203
208
For (& dbv1alpha1.AtlasMigration {}, builder .WithPredicates (predicate.GenerationChangedPredicate {})).
204
209
Owns (& dbv1alpha1.AtlasMigration {}).
205
210
Watches (& corev1.Secret {}, r .secretWatcher ).
0 commit comments