Skip to content

feat: replace TYPE_PATCH with TYPE_EVALUATE in lifecycle capabilities#68

Open
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
ermakov-oleg:feat/lifecycle-capabilities
Open

feat: replace TYPE_PATCH with TYPE_EVALUATE in lifecycle capabilities#68
ermakov-oleg wants to merge 1 commit intooperasoftware:mainfrom
ermakov-oleg:feat/lifecycle-capabilities

Conversation

@ermakov-oleg
Copy link

Summary

Port of upstream #378, #222

Problem: The plugin declared TYPE_PATCH capability 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 EVALUATE lifecycle verb. This repository already targets CloudNativePG v1.27.x, so the requirement is already satisfied.

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>
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.

1 participant