Skip to content

Commit

Permalink
fix: fix nil pointer if the record in the status but not in the spec
Browse files Browse the repository at this point in the history
ref: longhorn/longhorn 10464

Signed-off-by: Jack Lin <[email protected]>
(cherry picked from commit a69b53b)
  • Loading branch information
ChanYiLin authored and mergify[bot] committed Feb 20, 2025
1 parent 56f93bb commit 2e151b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ func (nc *NodeController) syncBackingImageEvictionRequested(node *longhorn.Node)
}
} else {
for _, backingImage := range diskBackingImageMap[diskUUID] {
if backingImage.Spec.DiskFileSpecMap[diskUUID].EvictionRequested {
if diskFileSpec, ok := backingImage.Spec.DiskFileSpecMap[diskUUID]; ok && diskFileSpec.EvictionRequested {
// if it is previously set to true, cancel the eviction request
backingImage.Spec.DiskFileSpecMap[diskUUID].EvictionRequested = false
backingImagesToSync = append(backingImagesToSync, backingImageToSync{backingImage, diskUUID, false})
Expand Down

0 comments on commit 2e151b2

Please sign in to comment.