Skip to content

fix(k8s): keep the annotations of the Sentinel Deployment on update - #332

Merged
Saremox merged 3 commits into
mainfrom
claude/fix-sentinel-wait-state
Oct 19, 2026
Merged

Saremox merged 3 commits into
mainfrom
claude/fix-sentinel-wait-state

Conversation

@Saremox

@Saremox Saremox commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Changes proposed on the PR:

  • CreateOrUpdateDeployment keeps the stored annotations. The API server increments the generation of a Deployment when its annotations change. The operator updates the Sentinel Deployment in each reconcile, because the generated spec leaves out API defaults such as the probe periods. Each update removed deployment.kubernetes.io/revision and started a further generation. The master replacement waits for the Sentinel rollout per generation, so the wait started again in each reconcile. The soak showed the Info line in each reconcile (redis-chain-62-sent, 16 lines in 21 seconds), and the 10-minute bound of the wait was never reached. A desired annotation replaces a stored annotation with the same key.
  • Annotations that other tools add to the Sentinel Deployment (ArgoCD, kubectl last-applied) stay. Before, the operator removed them in every reconcile.
  • createOrUpdate gets an optional keep hook for this merge.

The operator still sends a no-op update of the Sentinel Deployment in each reconcile, because deploymentUpToDate does not normalize the API defaults. This is a separate change.

Tests: TestUpdateRedisesPodsBoundsTheSentinelRolloutWaitOverReconciles (the real Ensure of the Sentinel Deployment against a fake API server with the defaults and the generation rule, then the gate, over 5 reconciles: Info once, the start of the wait stays, Warning and master delete after 10 minutes) and TestDeploymentServiceUpdateKeepsTheStoredAnnotations fail on main. TestDeploymentServiceUpdateWritesTheDesiredAnnotations fails when the merge gives the stored annotations priority. Not tested on a real API server; the defaults and the generation rule come from the Kubernetes source.


Generated by Claude Code

The desired Sentinel Deployment leaves out fields that the API server
defaults, for example the probe periods. Thus the operator updates the
Deployment in each reconcile. The update had no annotations, so it removed
deployment.kubernetes.io/revision, and the API server incremented the
generation. The wait of the master replacement for the Sentinel rollout
counts per generation, so it started again in each reconcile. The soak
showed its Info line in each reconcile, and the 10-minute bound was never
reached. The update keeps the stored annotations, so the generation changes
only with a change of the spec.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G4mmyo3sqLwf23m5FE2nBE
An update of a Deployment without annotations sends no empty map, as
before the merge of the stored annotations.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G4mmyo3sqLwf23m5FE2nBE
…ed one

The test fails when the merge gives the stored annotations priority. The
comments state why a comparison of the annotations is safe and what the
update count of the Sentinel rollout test checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G4mmyo3sqLwf23m5FE2nBE

Saremox commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T10:44:15.518653Z 5d1af00 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 5d1af00dbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Saremox
Saremox merged commit d0c0d17 into main Oct 19, 2026
17 checks passed
@Saremox
Saremox deleted the claude/fix-sentinel-wait-state branch October 19, 2026 20:34
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