Skip to content

Commit

Permalink
Update CreateILBSubnet() to catch 400s as well
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerhance committed Sep 27, 2019
1 parent 60afa35 commit bb876b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/e2e/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ func CreateILBSubnet(s *Sandbox, name string, ipCidrRange string) error {
klog.V(2).Infof("Creating ILB Subnet: %+v", subnet)
err := s.f.Cloud.BetaSubnetworks().Insert(context.Background(), meta.RegionalKey(subnet.Name, s.f.Region), subnet)
if err != nil {
// GCE returns a 409 when there is already an "ACTIVE" subnet set up for ILB
if utils.IsHTTPErrorCode(err, http.StatusConflict) {
klog.V(3).Info("ILB subnet already exists")
// GCE returns a 409 or 400 when there is already an subnet in the range
if utils.IsHTTPErrorCode(err, http.StatusConflict) || utils.IsHTTPErrorCode(err, http.StatusBadRequest) {
klog.V(3).Infof("Warning: ILB subnet already exists: %v", err)
return ErrSubnetExists
} else {
return fmt.Errorf("Error creating ILB subnet: %v", err)
Expand Down

0 comments on commit bb876b6

Please sign in to comment.