dragonflydb / dragonflydb/dragonfly-operator
Handle immutable fields with a ValidatingWebhook
- Dominant language
- Go
- Stars
- 357
- Forks
- 111
- PR merge metrics
- No merged PRs in 30d
Description
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:
```yaml
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.
```yaml
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.
Contributor guide
Assessment
This issue has not been assessed yet.