Skip to content

Commit

Permalink
BugFixes:
Browse files Browse the repository at this point in the history
- findMatchingEvacuatedResource should only consider Diskfull resources
- Nil pointer check: can be nil when node is offline
  • Loading branch information
boedy committed Oct 30, 2023
1 parent 670dc7d commit 2261105
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/linstorsatellite_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ func (r *LinstorSatelliteReconciler) evacuateNode(ctx context.Context, lc *linst

findMatchingEvacuatedResource := func(nodeRes lclient.ResourceWithVolumes) *lclient.ResourceWithVolumes {
for _, evacuatedRes := range evacuatedResources {
if utils.IsDisklessResource(evacuatedRes) {
continue
}
if nodeRes.Name == evacuatedRes.Name && evacuatedRes.Props[NodeEvacuationProp] == node.Name {
return &evacuatedRes
}
Expand Down Expand Up @@ -527,6 +530,9 @@ func (r *LinstorSatelliteReconciler) undoNodeEvacuation(ctx context.Context, lc
})

for _, resource := range res {
if resource.State == nil || resource.State.InUse == nil {
continue
}
// If an evacuated resource is in use, it means we can delete the original resource.
// We also update the resource properties to remove the NodeEvacuationProp
// as we've just deleted the original resource it was pointing to.
Expand Down

0 comments on commit 2261105

Please sign in to comment.