Skip to content

Commit

Permalink
Fix panic in Operator occuring during node replacement
Browse files Browse the repository at this point in the history
Log messages and progressing condition were using nil Pod object which
caused panic due to nil pointer dereference.

Fixes #1287
  • Loading branch information
zimnx committed Jun 27, 2023
1 parent 57a2b85 commit 914eb58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/scyllacluster/sync_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ func (scc *Controller) syncServices(

klog.V(2).InfoS("Pod has not been recreated by the StatefulSet controller yet",
"ScyllaCluster", klog.KObj(sc),
"Pod", klog.KObj(pod),
"Pod", klog.KObj(svc),
)
progressingConditions = append(progressingConditions, metav1.Condition{
Type: serviceControllerProgressingCondition,
Status: metav1.ConditionTrue,
Reason: "WaitingForPodRecreation",
Message: fmt.Sprintf("Service %q is waiting for StatefulSet controller to recreate pod %q.", naming.ObjRef(svc), naming.ObjRef(pod)),
Message: fmt.Sprintf("Service %q is waiting for StatefulSet controller to recreate pod.", naming.ObjRef(svc)),
ObservedGeneration: sc.Generation,
})
} else {
Expand Down

0 comments on commit 914eb58

Please sign in to comment.