dragonflydb / dragonflydb/dragonfly-operator
failed to reconcile dragonfly resource
- Dominant language
- Go
- Stars
- 357
- Forks
- 111
- PR merge metrics
- No merged PRs in 30d
Description
We're using the DragonFly Operator 1.1.11 with Kubernetes 1.21.14
For all our DragonFly deployments, we have these lines in the operator log:
```
manager 2025-04-24T15:14:30Z INFO reconciling dragonfly object {"controller": "Dragonfly", "controllerGroup": "dragonflydb.io", "controllerKind": "Dragonfly", "Dragonfly": {"name":"dragonfly-sample","namespace":"dev-tools"}, "namespace": "dev-tools", "name": "dragonfly-sample", "reconcileID": "19dbbd8b-b394-4f56-8e9a-340e315a67a1"}
manager 2025-04-24T15:14:30Z INFO reconciling dragonfly resource {"controller": "Dragonfly", "controllerGroup": "dragonflydb.io", "controllerKind": "Dragonfly", "Dragonfly": {"name":"dragonfly-sample","namespace":"dev-tools"}, "namespace": "dev-tools", "name": "dragonfly-sample", "reconcileID": "19dbbd8b-b394-4f56-8e9a-340e315a67a1", "Kind": "StatefulSet", "Namespace": "dev-tools", "Name": "dragonfly-sample"}
manager 2025-04-24T15:14:30Z INFO reconciling dragonfly resource {"controller": "Dragonfly", "controllerGroup": "dragonflydb.io", "controllerKind": "Dragonfly", "Dragonfly": {"name":"dragonfly-sample","namespace":"dev-tools"}, "namespace": "dev-tools", "name": "dragonfly-sample", "reconcileID": "19dbbd8b-b394-4f56-8e9a-340e315a67a1", "Kind": "Service", "Namespace": "dev-tools", "Name": "dragonfly-sample"}
manager 2025-04-24T15:14:30Z ERROR failed to reconcile dragonfly resource {"controller": "Dragonfly", "controllerGroup": "dragonflydb.io", "controllerKind": "Dragonfly", "Dragonfly": {"name":"dragonfly-sample","namespace":"dev-tools"}, "namespace": "dev-tools", "name": "dragonfly-sample", "reconcileID": "19dbbd8b-b394-4f56-8e9a-340e315a67a1", "error": "failed to update resource: Service \"dragonfly-sample\" is invalid: metadata.resourceVersion: Invalid value: \"\": must be specified for an update"}
manager github.com/dragonflydb/dragonfly-operator/internal/controller.(*DragonflyReconciler).Reconcile
manager /workspace/internal/controller/dragonfly_controller.go:73
manager sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
manager /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:114
manager sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
manager /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:311
manager sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
manager /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:261
manager sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
manager /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:222
```
The DragonFly manifest looks like this:
```apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
creationTimestamp: "2024-10-01T14:18:34Z"
generation: 1
labels:
app.kubernetes.io/created-by: dragonfly-operator
app.kubernetes.io/instance: dragonfly-sample
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: dragonfly
app.kubernetes.io/part-of: dragonfly-operator
name: dragonfly-sample
namespace: dev-tools
resourceVersion: "3424922735"
uid: 58238e86-01c9-4dc8-9501-7ed1f06aa7fe
spec:
args:
- --proactor_threads=4
imagePullPolicy: Always
replicas: 2
resources:
limits:
memory: 1.5Gi
requests:
cpu: 500m
memory: 1.2Gi
status:
phase: ready
```
Everything seems to work fine. The Service exists and the operator properly recreates it, when we delete it.
Contributor guide
Research direction
Start in internal/controller/dragonfly_controller.go around line 73 and trace the reconciliation of the Dragonfly resource's StatefulSet and Service. Reproduce with the provided Dragonfly manifest or an existing Service, then verify that reconciliation completes without the resourceVersion error and that deleting the Service still triggers recreation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100