vpcagent: ovn: guestnetwork: guard against empty dhcpopt

This commit is contained in:
Yousong Zhou
2020-04-24 18:32:08 +08:00
parent 1c50ffb216
commit 0578d6c498
+3
View File
@@ -217,6 +217,9 @@ func (keeper *OVNNorthboundKeeper) ClaimGuestnetwork(ctx context.Context, guestn
res := keeper.cli.Must(ctx, "find dhcpopt", args)
dhcpOpt = strings.TrimSpace(res.Output)
}
if dhcpOpt == "" {
return fmt.Errorf("cannot find dhcpopt for subnet %s", guestnetwork.NetworkId)
}
}
gnp := &ovnutil.LogicalSwitchPort{