Skip to content

Commit

Permalink
Merge pull request #873 from spencerhance/ilb-subnet-e2e-fix
Browse files Browse the repository at this point in the history
Update CreateILBSubnet() to catch 400s as well
  • Loading branch information
k8s-ci-robot authored Sep 27, 2019
2 parents 5bef228 + bb876b6 commit 2f7515d
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 2f7515d

Please sign in to comment.