Skip to content

Commit

Permalink
fix: fix nil pointer error
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Aug 31, 2024
1 parent 7305791 commit ad96d4f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Note 🍻

EMQX Operator 2.2.23 has been released.
EMQX Operator 2.2.24-rc.1 has been released.

## Supported version
+ apps.emqx.io/v2beta1
Expand Down Expand Up @@ -29,7 +29,7 @@ helm repo update
helm upgrade --install emqx-operator emqx/emqx-operator \
--namespace emqx-operator-system \
--create-namespace \
--version 2.2.23
--version 2.2.24-rc.1
kubectl wait --for=condition=Ready pods -l "control-plane=controller-manager" -n emqx-operator-system
```

Expand Down
24 changes: 13 additions & 11 deletions controllers/apps/v2beta1/update_emqx_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,21 @@ func (u *updateStatus) reconcile(ctx context.Context, logger logr.Logger, instan
}
}

isEnterpriser := false
for _, node := range coreNodes {
if node.ControllerUID == currentSts.UID && node.Edition == "Enterprise" {
isEnterpriser = true
break
if currentSts != nil {
isEnterpriser := false
for _, node := range coreNodes {
if node.ControllerUID == currentSts.UID && node.Edition == "Enterprise" {
isEnterpriser = true
break
}
}
}
if isEnterpriser {
nodeEvacuationsStatus, err := getNodeEvacuationStatusByAPI(r)
if err != nil {
u.EventRecorder.Event(instance, corev1.EventTypeWarning, "FailedToGetNodeEvacuationStatuses", err.Error())
if isEnterpriser {
nodeEvacuationsStatus, err := getNodeEvacuationStatusByAPI(r)
if err != nil {
u.EventRecorder.Event(instance, corev1.EventTypeWarning, "FailedToGetNodeEvacuationStatuses", err.Error())
}
instance.Status.NodeEvacuationsStatus = nodeEvacuationsStatus
}
instance.Status.NodeEvacuationsStatus = nodeEvacuationsStatus
}

// update status condition
Expand Down

0 comments on commit ad96d4f

Please sign in to comment.