e2e: add controller recovery test - #152
Open
ptalgulk01 wants to merge 1 commit into
Open
Conversation
Collaborator
Author
HarshwardhanPatil07
requested changes
Sep 2, 2026
Comment on lines
+640
to
+665
| // Phase 3: Patch pool to update image while controller is down. | ||
| updateRef := env.NodeImageUpdateDigestedPullSpec() | ||
|
|
||
| poolModified := pool.DeepCopy() | ||
| poolModified.Spec.Image.Ref = updateRef | ||
| g.Expect(env.Client.Patch(ctx, poolModified, client.MergeFrom(pool))).To(Succeed()) | ||
| *pool = *poolModified | ||
|
|
||
| t.Logf("Patched pool to update image %s while controller is down", updateRef) | ||
|
|
||
| // Wait briefly to confirm nothing happens while controller is down. | ||
| g.Consistently(func() (bootcv1alpha1.BootcNodeStatus, error) { | ||
| var bn bootcv1alpha1.BootcNode | ||
| err := env.Client.Get(ctx, client.ObjectKey{Name: nodeName}, &bn) | ||
| return bn.Status, err | ||
| }).WithTimeout(10*time.Second).WithPolling(2*time.Second).Should( | ||
| HaveField("Booted.ImageDigest", Equal(env.NodeImageDigest())), | ||
| "node should not update while controller is down", | ||
| ) | ||
|
|
||
| // Phase 4: Scale controller back to one. | ||
| g.Expect(env.Client.Get(ctx, deployKey, controllerDeploy)).To(Succeed()) | ||
| modified = controllerDeploy.DeepCopy() | ||
| one := int32(1) | ||
| modified.Spec.Replicas = &one | ||
| g.Expect(env.Client.Patch(ctx, modified, client.MergeFrom(controllerDeploy))).To(Succeed()) |
Collaborator
There was a problem hiding this comment.
Test never interrupts an active rollout
The image changes while the controller is already stopped, so restart simply begins a new rollout.
HarshwardhanPatil07
left a comment
Collaborator
There was a problem hiding this comment.
You will need to sign DCO
Signed-off-by: Prachiti Talgulkar <ptalgulk01@users.noreply.github.com>
ptalgulk01
force-pushed
the
e2e-controller-recovery
branch
from
September 2, 2026 16:41
e14d71b to
f5b290b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context
Part of the e2e test planning in #69 (scenario 5: kill controller/daemon during rollout).
Manual testing also revealed that scenarios 4 (faulty node after reboot) and 8 (cross-distro bad image) both fail — the controller has no reboot timeout and doesn't correlate Node.Ready status, so nodes stuck after reboot are never marked degraded. Those need feature work before tests can be written.
Test plan