Add IsReadyForInput to statefulset and deployment packages - #733
Merged
Conversation
lmiccini
force-pushed
the
ensure-fresh
branch
2 times, most recently
from
August 14, 2026 08:24
59e9f79 to
299ce44
Compare
IsReadyForInput reads a StatefulSet/Deployment directly from an uncached API reader and reports whether the workload is fully rolled out with the expected configuration: IsReady must pass and a container must carry a CONFIG_HASH env var whose literal value equals the expected hash. This lets a parent correlate a child's readiness with the specific input it applied, so a rotated secret's old consumer finalizer is only released once the new config has provably rolled out. Config-hash matching lives in a single shared helper, env.ConfigHashMatches: - An empty configHash never matches, so a not-yet-computed (or cleared) hash cannot be treated as "applied" and trigger a premature finalizer release. - Both init and regular containers are scanned. - Only a literal CONFIG_HASH value is compared; a value sourced via ValueFrom is ignored, per the operator convention of injecting a literal hash. deployment.ConfigHashEnvVar and statefulset.ConfigHashEnvVar are kept as aliases of env.ConfigHashEnvVar for backward compatibility. The Helper.apiReader field and its Get/SetAPIReader accessors are omitted: call sites pass the reconciler's own APIReader directly to IsReadyForInput, so a Helper-held reader would be an unused nil-default footgun. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Uh oh!
There was an error while loading. Please reload this page.