Skip to content

Implement strategic merge patch (#62)#108

Merged
jdheyburn merged 6 commits into
valkey-io:mainfrom
hieu2102:make-exporter-sidecar-more-generic
Mar 16, 2026
Merged

Implement strategic merge patch (#62)#108
jdheyburn merged 6 commits into
valkey-io:mainfrom
hieu2102:make-exporter-sidecar-more-generic

Conversation

@hieu2102
Copy link
Copy Markdown
Contributor

@hieu2102 hieu2102 commented Mar 9, 2026

Implements #62

  • add field Containers to ValkeyClusterSpec
  • add function deployment.mergePatchContainers
  • modify the function signatures of deployment.generateContainersDef and deployment.createClusterDeployment to return error in addition to the output object
  • add tests

hieu2102 added 4 commits March 9, 2026 14:17
Signed-off-by: hieu2102 <hieund2102@gmail.com>
Signed-off-by: hieu2102 <hieund2102@gmail.com>
Signed-off-by: hieu2102 <hieund2102@gmail.com>
Signed-off-by: hieu2102 <hieund2102@gmail.com>
Copy link
Copy Markdown
Collaborator

@jdheyburn jdheyburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very straight forward to me. I've not tested it locally.

Should we update ExporterSpec such that it only supports enabled? Since all customisation would now be handled via the new Containers merge?

Comment thread internal/controller/deployment.go
Comment thread test/e2e/valkeycluster_test.go
@bjosv
Copy link
Copy Markdown
Collaborator

bjosv commented Mar 10, 2026

Should we update ExporterSpec such that it only supports enabled? Since all customisation would now be handled via the new Containers merge?

Unless they are convenient and commonly changed configs. I guess there is nothing blocking a user to modify "valkey-server" in the same way, to set cluster.Spec.Resources using the merge patch function instead.

@jdheyburn
Copy link
Copy Markdown
Collaborator

@bjosv True, nothing stops the user doing that. Perhaps we can support these top-level fields for the time being.

@sandeepkunusoth
Copy link
Copy Markdown
Member

Just curious, some other operator uses podTemplateSpec, which is useful when users need volumes, initContainers(maybe example usecase where we are reading acl secrets from vault etc)

Signed-off-by: hieu2102 <hieund2102@gmail.com>
@jdheyburn
Copy link
Copy Markdown
Collaborator

@sandeepkunusoth I would image we would expose those fields (Volumes, etc.) at the root level similar to what Prometheus Operator does: https://github.com/prometheus-operator/prometheus-operator/blob/f3c143e5499e020744d57ba8a94045af71bf1a83/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go#L28

What example operators are you referencing?

@sandeepkunusoth
Copy link
Copy Markdown
Member

@jdheyburn
Copy link
Copy Markdown
Collaborator

I think podTemplateSpec and containerSpec are indifferent to each other, and we have already started building on this model (we have the PR ready here). I like the idea of our operator providing some abstraction away from the pod template that we're writing on their behalf. Any fields not included in the CRD we can look to expose ourselves.

I appreciate the call out though @sandeepkunusoth

Copy link
Copy Markdown
Collaborator

@jdheyburn jdheyburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this @hieu2102!

@jdheyburn jdheyburn marked this pull request as draft March 13, 2026 17:24
@jdheyburn jdheyburn marked this pull request as ready for review March 13, 2026 17:24
@jdheyburn jdheyburn enabled auto-merge (squash) March 16, 2026 09:53
@jdheyburn
Copy link
Copy Markdown
Collaborator

jdheyburn commented Mar 16, 2026

@hieu2102 can you try pushing a dummy commit so to retrigger the CI builds? Seems there is some hangover from a Github issue last week

git commit --allow-empty -m "chore: trigger CI" --signoff
git push

@jdheyburn jdheyburn disabled auto-merge March 16, 2026 10:00
Signed-off-by: hieu2102 <hieund2102@gmail.com>
@hieu2102
Copy link
Copy Markdown
Contributor Author

@jdheyburn done

@jdheyburn jdheyburn merged commit e6d9dad into valkey-io:main Mar 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants