Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle immutable fields with a ValidatingWebhook #272

Open
Skaronator opened this issue Dec 10, 2024 · 1 comment
Open

Handle immutable fields with a ValidatingWebhook #272

Skaronator opened this issue Dec 10, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@Skaronator
Copy link

I'm just in the evaluation process of a memcached / redis operator and dragonfly seems to be a valid option. While initial testing the operator I noticed that it doesn't handle some changes correctly, resulting in a "broken" deployment.

For example adding snapshot to a existing PVC breaks the Dragonfly resource.

Deploy this:

apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  name: dragonfly-sample
spec:
  replicas: 3
  resources:
    requests:
      cpu: 100m
      memory: 256Mi

Then add a PVC and you can successfully apply this resource, resulting in many errors in the operator.

apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  name: dragonfly-sample
spec:
  replicas: 3
  resources:
    requests:
      cpu: 100m
      memory: 256Mi
  snapshot:
    cron: "* * * * *"
    persistentVolumeClaimSpec:
      storageClassName: efs
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 2Gi

Other Operators handle this way better with an ValidatingWebhookConfiguration. They throw an error and saying that the snapshot field is immutable and cannot be changed without recreating that resource.

@Pothulapati
Copy link
Collaborator

Other Operators handle this way better with an ValidatingWebhookConfiguration. They throw an error and saying that the snapshot field is immutable and cannot be changed without recreating that resource.

Thanks for the report.We can do the same I think.

@Pothulapati Pothulapati added the help wanted Extra attention is needed label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants