feat: replace TYPE_PATCH with TYPE_EVALUATE in lifecycle capabilities#68
Open
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
Open
feat: replace TYPE_PATCH with TYPE_EVALUATE in lifecycle capabilities#68ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
Conversation
Port of upstream PRs cloudnative-pg#378 and cloudnative-pg#222. TYPE_PATCH is useless for Pods (immutable in K8s). TYPE_EVALUATE allows triggering rolling deployment when sidecar config changes. Also updates cnpg-i to v0.3.0. Signed-off-by: ermakov-oleg <ermakovolegs@gmail.com>
3ebe8ea to
1ba9ce1
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
Port of upstream #378, #222
Problem: The plugin declared
TYPE_PATCHcapability for pod mutation, which tells the CNPG operator to apply the plugin's response as a direct JSON patch. This is fragile - the plugin must produce correct patches for every possible pod state, and ordering issues between plugins can cause conflicts.Fix: Changed to
TYPE_EVALUATE, which lets the operator evaluate the plugin's desired state before creating/updating pods and trigger rollout when needed. This is the recommended approach in cnpg-i v0.3.0 and reduces the risk of conflicts when multiple plugins mutate the same pod.Compatibility: Requires a CNPG operator version that supports the
EVALUATElifecycle verb. This repository already targets CloudNativePG v1.27.x, so the requirement is already satisfied.