Skip to content

Commit fb7546d

Browse files
bdchathamclaude
andcommitted
fix: use UpdatedReplicas instead of ReadyReplicas in observeCurrentImage
ReadyReplicas requires pod readiness probes to pass, which depends on the sidecar reporting ready via /v0/healthz. But the sidecar only becomes ready after the MarkReady plan step runs, which is sequenced after AwaitSpecUpdate, which reads currentImage, which requires observeCurrentImage to succeed. Circular dependency. UpdatedReplicas counts pods running the desired template regardless of readiness probe status. This correctly signals "the image change took effect" without requiring the full sidecar initialization to complete. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2a572ba commit fb7546d

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

internal/controller/node/controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ func (r *SeiNodeReconciler) observeCurrentImage(ctx context.Context, node *seiv1
197197
return err
198198
}
199199

200-
if sts.Status.CurrentRevision == "" || sts.Status.CurrentRevision != sts.Status.UpdateRevision {
201-
return nil
202-
}
203-
if sts.Status.ReadyReplicas < 1 {
200+
if sts.Spec.Replicas == nil || sts.Status.UpdatedReplicas < *sts.Spec.Replicas {
204201
return nil
205202
}
206203

internal/controller/node/reconciler_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ func TestObserveCurrentImage_UpdatesWhenConverged(t *testing.T) {
249249
WithStatusSubresource(&seiv1alpha1.SeiNode{}, &appsv1.StatefulSet{}).
250250
Build()
251251

252-
sts.Status.CurrentRevision = testRevision
253-
sts.Status.UpdateRevision = testRevision
254-
sts.Status.ReadyReplicas = 1
252+
sts.Status.UpdatedReplicas = 1
255253
g.Expect(c.Status().Update(ctx, sts)).To(Succeed())
256254

257255
r := &SeiNodeReconciler{Client: c, Scheme: s}

0 commit comments

Comments
 (0)