Skip to content

test(operator): patch the Jumpstarter so status writes cannot conflict - #1350

Merged
mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:fix/operator-e2e-update-conflicts
Nov 18, 2026
Merged

mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:fix/operator-e2e-update-conflicts

Conversation

@bennyz

@bennyz bennyz commented Nov 16, 2026

Copy link
Copy Markdown
Member

The operator e2e specs changed the Jumpstarter resource by reading it, editing the copy and writing it back once. This can cause conflicts

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The e2e tests now use updateJumpstarter to modify Jumpstarter resources. The helper applies mutations through merge patches. The tests cover controller and router settings, ingress, provisioning, TLS, cert-manager, and telemetry.

Changes: E2E resource updates

Layer / File(s) Summary
Add Jumpstarter merge-patch helper
controller/deploy/operator/test/e2e/utils_test.go
updateJumpstarter fetches a resource, applies a mutation, and patches the difference. Fetch or patch failures fail the test.
Use helper in e2e tests
controller/deploy/operator/test/e2e/e2e_test.go, controller/deploy/operator/test/e2e/telemetry_e2e_test.go
Tests use updateJumpstarter to change controller and router settings, ingress endpoints, provisioning, TLS, cert-manager, and telemetry configuration. The controller certificate lookup declares err at the Get call.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: mangelajo, bkhizgiy

Merge Risk: Minimal · up to b8a46

This change only affects end-to-end tests, making them more resilient to conflicts with operator status writes. There is no production impact and no identified merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description states that the operator e2e specs read a Jumpstarter resource, edit the copy, and write it back once, which can cause conflicts. This relates directly to the changeset, which replaces…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the main change: the e2e tests now patch the Jumpstarter resource so that operator status writes cannot cause update conflicts. The changeset adds an updateJumpstarter helper that send…
Full details: Description check

Explanation

The description states that the operator e2e specs read a Jumpstarter resource, edit the copy, and write it back once, which can cause conflicts. This relates directly to the changeset, which replaces that read-modify-write pattern with the updateJumpstarter helper across the e2e test files. The description is brief but on-topic.

Full details: Title check

Explanation

The title names the main change: the e2e tests now patch the Jumpstarter resource so that operator status writes cannot cause update conflicts. The changeset adds an updateJumpstarter helper that sends a merge patch, and the tests switch to it. The title follows the test(operator) convention and is specific enough for a reviewer scanning history. The PR objectives describe the goal as retrying conflicting updates, which the patch approach addresses by avoiding the conflict path rather than retrying, so the title matches the implementation.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit patches a setting with care,
Then checks that the tests still run there.
From routers to TLS,
Each change finds its address,
While telemetry gets its share.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25cc52f1-22d0-4b20-ad99-af7bf66be9fb
Commits

Reviewing files that changed from the base of the PR and between 2f291e6 and b8a46b4.

Files selected for processing: 1

  • controller/deploy/operator/test/e2e/utils_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

The operator e2e specs changed the Jumpstarter resource by reading it,
editing the copy and writing the whole object back. The operator writes
the resource's status while it reconciles each change, and a status
write changes the resource version too, so a spec that runs right after
another spec's change can lose the race and fail with "the object has
been modified". That happened to "should update provisioning config
when autoProvisioning is enabled" on jumpstarter-dev#1319.

Every such write now goes through updateJumpstarter, which sends only
the changed fields as a merge patch without a resource version, so the
API server applies them to the current object. The operator never
writes the spec, so the patch lands on the spec the test read.

The cleanups that restore a setting after a spec ignored errors from
both the read and the write, so a lost race there left the next spec of
the ordered container running against the wrong configuration without
saying so. They use the same helper, and a failed restore now fails the
spec.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@bennyz
bennyz force-pushed the fix/operator-e2e-update-conflicts branch from 2f291e6 to b8a46b4 Compare November 16, 2026 13:52
@bennyz bennyz changed the title test(operator): retry Jumpstarter updates that lose to status writes test(operator): patch the Jumpstarter so status writes cannot conflict Nov 16, 2026
@mangelajo
mangelajo added this pull request to the merge queue Nov 18, 2026
Merged via the queue into jumpstarter-dev:main with commit 02c916d Nov 18, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants