Remove the dependency of 'ipset' package on Kubernetes

We don't want everyone that uses the `net` package to get a transitive
dependency on the Kubernetes APIs, so have it define the `UID` type.

Conceptually this is a simple change because `UID` is a `string`, but
unfortunately it is used in a lot of places.
This commit is contained in:
Bryan Boreham committed 2020-07-29 13:08:35 +00:00
1 parent a3c76e141b
commit ca4f93d0d7
8 files changed
+103 -100

No files matched your search

+2 -3
View File
@@ -11,7 +11,6 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/vishvananda/netlink"
"k8s.io/apimachinery/pkg/types"
"github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/common/chains"
@@ -588,13 +587,13 @@ func ConfigureIPTables(config *BridgeConfig, ips ipset.Interface) error {
type NoMasqLocalTracker struct {
ips ipset.Interface
owner types.UID
owner ipset.UID
}
func NewNoMasqLocalTracker(ips ipset.Interface) *NoMasqLocalTracker {
return &NoMasqLocalTracker{
ips: ips,
owner: types.UID(0), // dummy ipset owner
owner: ipset.UID(0), // dummy ipset owner
}
}