Skip to content

Commit

Permalink
Merge pull request #189 from mjnichol2/mjnichol2
Browse files Browse the repository at this point in the history
Removes logic that checks for a "port already in use" error
  • Loading branch information
k8s-ci-robot committed Nov 1, 2018
2 parents a8ea205 + a5c1704 commit 8a1511d
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/envtest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package envtest

import (
"fmt"
"net"
"os"
"path/filepath"
"strings"
"time"

apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
Expand Down Expand Up @@ -169,17 +167,6 @@ func (te *Environment) startControlPlane() error {
if err == nil {
break
}
// code snippet copied from following answer on stackoverflow
// https://stackoverflow.com/questions/51151973/catching-bind-address-already-in-use-in-golang
if opErr, ok := err.(*net.OpError); ok {
if opErr.Op == "listen" && strings.Contains(opErr.Error(), "address already in use") {
if stopErr := te.ControlPlane.Stop(); stopErr != nil {
return fmt.Errorf("failed to stop controlplane in response to bind error 'address already in use'")
}
}
} else {
return err
}
}
if numTries == maxRetries {
return fmt.Errorf("failed to start the controlplane. retried %d times", numTries)
Expand Down

0 comments on commit 8a1511d

Please sign in to comment.