Skip to content

Commit 31e1e0f

Browse files
committed
Fix volume status not updating to in-use after server attachment
Apply the same fix as the port controller: when serverToVolumeMapFunc detects a volume that is listed in the server's interfaces and already has the correct attachment info, but the volume's Cinder status is not in-use, trigger a re-reconciliation to pick up the current status from Cinder.
1 parent a2b2b19 commit 31e1e0f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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)