mirror of https://github.com/kubernetes/kops.git
Fail if we find multiple sgs with same name
This commit is contained in:
parent
14a6f92f53
commit
5cb63fb788
|
|
@ -497,9 +497,12 @@ func (b *FirewallModelBuilder) getExistingRules(sgMap map[string]*openstacktasks
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(sgs) != 1 {
|
if len(sgs) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if len(sgs) > 1 {
|
||||||
|
return fmt.Errorf("Found multiple security groups with the same name: %v", sgName)
|
||||||
|
}
|
||||||
sg := sgs[0]
|
sg := sgs[0]
|
||||||
sgt.Name = fi.String(sg.Name)
|
sgt.Name = fi.String(sg.Name)
|
||||||
sgIdMap[sg.ID] = sgt
|
sgIdMap[sg.ID] = sgt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue