Skip to content

Commit 4c0cd0a

Browse files
committed
Add SharderConfig.controller.sharder.concurrentMoves config field
1 parent 2c33641 commit 4c0cd0a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

pkg/apis/config/v1alpha1/defaults.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func SetDefaults_SharderController(obj *SharderController) {
9595
if obj.SyncPeriod == nil {
9696
obj.SyncPeriod = &metav1.Duration{Duration: 5 * time.Minute}
9797
}
98+
if obj.ConcurrentMoves == nil {
99+
obj.ConcurrentMoves = ptr.To[int32](100)
100+
}
98101
}
99102

100103
func SetDefaults_Webhook(obj *Webhook) {

pkg/apis/config/v1alpha1/defaults_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ var _ = Describe("SharderConfig defaulting", func() {
9191

9292
Expect(obj.Controller).To(Equal(Controller{
9393
Sharder: &SharderController{
94-
SyncPeriod: &metav1.Duration{Duration: 5 * time.Minute},
94+
SyncPeriod: &metav1.Duration{Duration: 5 * time.Minute},
95+
ConcurrentMoves: ptr.To[int32](100),
9596
},
9697
}))
9798
})

pkg/apis/config/v1alpha1/types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,15 @@ type Controller struct {
8383

8484
// SharderController configures the sharder controller.
8585
type SharderController struct {
86-
// SyncPeriod configures how often a periodic resync of all object assignments in a ring in performed.
86+
// SyncPeriod configures how often a periodic resync of all object assignments in a ring is performed.
8787
// Defaults to 5m
8888
// +optional
8989
SyncPeriod *metav1.Duration `json:"syncPeriod,omitempty"`
90+
// ConcurrentMoves configures how many objects of the same ControllerRing are moved (or drained) concurrently at
91+
// maximum.
92+
// Defaults to 100
93+
// +optional
94+
ConcurrentMoves *int32 `json:"concurrentMoves,omitempty"`
9095
}
9196

9297
// Webhook configures webhooks and the webhook server.

pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)