@@ -25,6 +25,7 @@ import (
25
25
"k8s.io/apimachinery/pkg/api/resource"
26
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
27
"k8s.io/apimachinery/pkg/labels"
28
+ "k8s.io/apimachinery/pkg/types"
28
29
)
29
30
30
31
const (
@@ -349,6 +350,33 @@ var _ = g.Describe("NodeConfig Optimizations", framework.Serial, func() {
349
350
scyllaContainerID , err := controllerhelpers .GetScyllaContainerID (pod )
350
351
o .Expect (err ).NotTo (o .HaveOccurred ())
351
352
353
+ framework .By ("Bumping tuning DaemonSet sync and waiting for it to become healthy" )
354
+
355
+ dsList , err := f .KubeAdminClient ().AppsV1 ().DaemonSets (naming .ScyllaOperatorNodeTuningNamespace ).List (ctx , metav1.ListOptions {
356
+ LabelSelector : labels.Set {
357
+ "app.kubernetes.io/name" : naming .NodeConfigAppName ,
358
+ }.AsSelector ().String (),
359
+ })
360
+ o .Expect (err ).NotTo (o .HaveOccurred ())
361
+ o .Expect (dsList .Items ).To (o .HaveLen (1 ), "there should be exactly 1 matching NodeConfig in this test" )
362
+ ds := & dsList .Items [0 ]
363
+
364
+ // At this point the DaemonSet controller in kube-controller-manager is notably rate-limited
365
+ // because of resource quota failures. We have to trigger an event to reset its queue rate limiter,
366
+ // or there will be a large delay.
367
+ ds , err = f .KubeAdminClient ().AppsV1 ().DaemonSets (naming .ScyllaOperatorNodeTuningNamespace ).Patch (
368
+ ctx ,
369
+ ds .Name ,
370
+ types .JSONPatchType ,
371
+ []byte (fmt .Sprintf (`[{"op": "add", "path": "/metadata/annotations/e2e-requeue", "value": %q}]` , time .Now ())),
372
+ metav1.PatchOptions {},
373
+ )
374
+
375
+ ctxTuningDS , ctxTuningDSCancel := utils .ContextForRollout (ctx , sc )
376
+ defer ctxTuningDSCancel ()
377
+ ds , err = controllerhelpers .WaitForDaemonSetState (ctxTuningDS , f .KubeAdminClient ().AppsV1 ().DaemonSets (ds .Namespace ), ds .Name , controllerhelpers.WaitForStateOptions {}, controllerhelpers .IsDaemonSetRolledOut )
378
+ o .Expect (err ).NotTo (o .HaveOccurred ())
379
+
352
380
framework .By ("Waiting for the NodeConfig to deploy" )
353
381
ctx3 , ctx3Cancel := context .WithTimeout (ctx , nodeConfigRolloutTimeout )
354
382
defer ctx3Cancel ()
0 commit comments