Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions internal/controllers/port/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,21 @@ func (actuator portActuator) checkAttachedServer(ctx context.Context, obj orcObj
}
}

// When the port is attached to a device but still reports DOWN,
// the Neutron status has not yet transitioned to ACTIVE (e.g.
// OVN is still binding the port). serverToPortMapFunc also
// detects this and triggers a reconcile, but it races with the
// port controller's own status write: the controller may
// overwrite Progressing=True with Progressing=False before the
// port becomes ACTIVE. Poll here so we keep Progressing=True
// until the transition completes.
if osResource.Status == PortStatusDown {
log.V(logging.Verbose).Info("port needs reconciliation: attached to server but status is DOWN",
"port", obj.Name,
"status", osResource.Status)
return progress.WaitingOnOpenStack(progress.WaitingOnReady, serverBuildPollingPeriod)
}

return nil
}

Expand Down
21 changes: 21 additions & 0 deletions internal/controllers/volume/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,31 @@ func handleDescriptionUpdate(updateOpts *volumes.UpdateOpts, resource *resourceS

func (actuator volumeActuator) GetResourceReconcilers(ctx context.Context, orcObject orcObjectPT, osResource *osResourceT, controller interfaces.ResourceController) ([]resourceReconciler, progress.ReconcileStatus) {
return []resourceReconciler{
actuator.checkAttachmentStatus,
actuator.updateResource,
}, nil
}

func (volumeActuator) checkAttachmentStatus(ctx context.Context, _ orcObjectPT, osResource *osResourceT) progress.ReconcileStatus {
log := ctrl.LoggerFrom(ctx)

// When the volume has attachments but Cinder still reports
// "available" rather than "in-use", the status transition has
// not completed yet. serverToVolumeMapFunc also detects this
// and triggers a reconcile, but it races with the volume
// controller's own status write: the controller may overwrite
// Progressing=True with Progressing=False before the volume
// becomes in-use. Poll here so we keep Progressing=True until
// the transition completes.
if len(osResource.Attachments) > 0 && osResource.Status != VolumeStatusInUse {
log.V(logging.Verbose).Info("volume needs reconciliation: attached to server but status is not in-use",
"status", osResource.Status)
return progress.WaitingOnOpenStack(progress.WaitingOnReady, volumeAvailablePollingPeriod)
}

return nil
}

type volumeHelperFactory struct{}

var _ helperFactory = volumeHelperFactory{}
Expand Down
Loading