Skip to content

Commit 42ed727

Browse files
committed
fixes listprivate ips for zoslight
Signed-off-by: Ashraf Fouda <ashraf.m.fouda@gmail.com>
1 parent 4fe70d8 commit 42ed727

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

pkg/provision/engine.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ func (n *NativeEngine) ListPrivateIPs(twin uint32, network gridtypes.Name) ([]st
11491149
ips := make([]string, 0)
11501150
for _, deployment := range deployments {
11511151
vms := deployment.ByType(zos.ZMachineType)
1152-
vms = append(vms, deployment.ByType(zos.ZMachineLightType)...)
11531152
for _, vm := range vms {
11541153

11551154
if vm.Result.State.IsAny(gridtypes.StateDeleted, gridtypes.StateError) {
@@ -1166,6 +1165,24 @@ func (n *NativeEngine) ListPrivateIPs(twin uint32, network gridtypes.Name) ([]st
11661165
}
11671166
}
11681167
}
1168+
1169+
vmsLight := deployment.ByType(zos.ZMachineLightType)
1170+
for _, vm := range vmsLight {
1171+
1172+
if vm.Result.State.IsAny(gridtypes.StateDeleted, gridtypes.StateError) {
1173+
continue
1174+
}
1175+
data, err := vm.WorkloadData()
1176+
if err != nil {
1177+
return nil, err
1178+
}
1179+
zmachine := data.(*zos.ZMachineLight)
1180+
for _, inf := range zmachine.Network.Interfaces {
1181+
if inf.Network == network {
1182+
ips = append(ips, inf.IP.String())
1183+
}
1184+
}
1185+
}
11691186
}
11701187
return ips, nil
11711188
}

0 commit comments

Comments
 (0)