Skip to content

Commit 4292243

Browse files
authored
Merge pull request #765 from shiftstack/reconcile-attached-down-ports
Fix port status not updating to ACTIVE after server interface attachment
2 parents dfc2657 + 31e1e0f commit 4292243

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

internal/controllers/port/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ func serverToPortMapFunc(ctx context.Context, k8sClient client.Client) handler.M
208208
log.V(logging.Verbose).Info("port needs reconciliation: listed in server status but deviceID not set",
209209
"port", client.ObjectKeyFromObject(port),
210210
"server", client.ObjectKeyFromObject(server))
211+
} else if portStatus.Status == PortStatusDown {
212+
shouldReconcile = true
213+
reason = "Port attached to server but status is still DOWN"
214+
log.V(logging.Verbose).Info("port needs reconciliation: attached to server but status is DOWN",
215+
"port", client.ObjectKeyFromObject(port),
216+
"server", client.ObjectKeyFromObject(server))
211217
}
212218
}
213219

internal/controllers/volume/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ func serverToVolumeMapFunc(ctx context.Context, k8sClient client.Client) handler
162162
log.V(logging.Verbose).Info("volume needs reconciliation: listed in server status but no attachment info",
163163
"volume", client.ObjectKeyFromObject(volume),
164164
"server", client.ObjectKeyFromObject(server))
165+
} else if volumeStatus.Status != VolumeStatusInUse {
166+
shouldReconcile = true
167+
reason = "Volume attached to server but status is not in-use"
168+
log.V(logging.Verbose).Info("volume needs reconciliation: attached to server but status is not in-use",
169+
"volume", client.ObjectKeyFromObject(volume),
170+
"server", client.ObjectKeyFromObject(server))
165171
}
166172
}
167173

0 commit comments

Comments
 (0)