Skip to content

Commit

Permalink
Merge pull request #189 from flupec/pf-fails-on-port
Browse files Browse the repository at this point in the history
Disable hosts entry remove when port-forward fails on one of the service ports
  • Loading branch information
cjimti authored Jul 7, 2021
2 parents f397fbf + f9a1b70 commit 0da4473
Show file tree
Hide file tree
Showing 9 changed files with 990 additions and 232 deletions.
3 changes: 2 additions & 1 deletion cmd/kubefwd/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,11 @@ func (opts *NamespaceOpts) AddServiceHandler(obj interface{}) {
NamespaceServiceLock: opts.NamespaceIPLock,
Svc: svc,
Headless: svc.Spec.ClusterIP == "None",
PortForwards: make(map[string]*fwdport.PortForwardOpts),
PortForwards: make(map[string][]*fwdport.PortForwardOpts),
SyncDebouncer: debounce.New(5 * time.Second),
DoneChannel: make(chan struct{}),
PortMap: opts.ParsePortMap(mappings),
ManualStopChannel: opts.ManualStopChannel,
}

// Add the service to the catalog of services being forwarded
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ go 1.16
require (
github.com/bep/debounce v1.2.0
github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a // indirect
github.com/golang/mock v1.4.1
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.1.1
github.com/stretchr/testify v1.6.1
github.com/txn2/txeh v1.2.1
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
k8s.io/api v0.20.4
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
Loading

0 comments on commit 0da4473

Please sign in to comment.