upup: fix dryrun when adding a subnet

When adding a subnet in --dryrun, the ID might not be set during a Find
This commit is contained in:
Justin Santa Barbara 2016-06-15 13:57:54 -04:00
parent a10c76a954
commit b147091e5c
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,10 @@ func subnetSlicesEqualIgnoreOrder(l, r []*Subnet) bool {
}
var rIDs []string
for _, s := range r {
if s.ID == nil {
glog.V(4).Infof("Subnet ID not set; returning not-equal: %v", s)
return false
}
rIDs = append(rIDs, *s.ID)
}
return utils.StringSlicesEqualIgnoreOrder(lIDs, rIDs)