Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CreateILBSubnet() to catch 400s as well #873

Merged
merged 1 commit into from
Sep 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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