Skip to content

Commit a8678cb

Browse files
committed
openshift: return an error if a machine doesn't have ports
1 parent d2ac91a commit a8678cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

openshift/pkg/infraclustercontroller/openstackcluster.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ func (r *OpenShiftClusterReconciler) getDefaultSubnetFromMachines(ctx context.Co
384384
if err != nil {
385385
return nil, fmt.Errorf("listing ports for instance %s: %w", instanceID, err)
386386
}
387+
if len(ports) == 0 {
388+
return nil, fmt.Errorf("no ports found for instance %s", instanceID)
389+
}
387390
for _, port := range ports {
388391
log := log.WithValues("port", port.ID)
389392

0 commit comments

Comments
 (0)