File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,8 @@ package envtest
18
18
19
19
import (
20
20
"fmt"
21
- "net"
22
21
"os"
23
22
"path/filepath"
24
- "strings"
25
23
"time"
26
24
27
25
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
@@ -169,17 +167,6 @@ func (te *Environment) startControlPlane() error {
169
167
if err == nil {
170
168
break
171
169
}
172
- // code snippet copied from following answer on stackoverflow
173
- // https://stackoverflow.com/questions/51151973/catching-bind-address-already-in-use-in-golang
174
- if opErr , ok := err .(* net.OpError ); ok {
175
- if opErr .Op == "listen" && strings .Contains (opErr .Error (), "address already in use" ) {
176
- if stopErr := te .ControlPlane .Stop (); stopErr != nil {
177
- return fmt .Errorf ("failed to stop controlplane in response to bind error 'address already in use'" )
178
- }
179
- }
180
- } else {
181
- return err
182
- }
183
170
}
184
171
if numTries == maxRetries {
185
172
return fmt .Errorf ("failed to start the controlplane. retried %d times" , numTries )
You can’t perform that action at this time.
0 commit comments