aboutsummaryrefslogtreecommitdiff
path: root/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-26 18:26:55 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-27 18:09:12 +0000
commitaf64e10400f8533a0c48ecdf5ab9b7fbf329e14e (patch)
tree59160e3841b440dd35189c724bbb4375a7be173b /vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go
parent26d7e3c7b85e28c4e42998c90fdcc14079f13eef (diff)
downloadpodman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.gz
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.bz2
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.zip
Vendor in lots of kubernetes stuff to shrink image size
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #554 Approved by: mheon
Diffstat (limited to 'vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go')
-rw-r--r--vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go b/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go
index 5b6fe933f..90ad58c63 100644
--- a/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go
+++ b/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go
@@ -21,8 +21,10 @@ import (
"strings"
)
+// IPNet maps string to net.IPNet.
type IPNet map[string]*net.IPNet
+// ParseIPNets parses string slice to IPNet.
func ParseIPNets(specs ...string) (IPNet, error) {
ipnetset := make(IPNet)
for _, spec := range specs {
@@ -96,9 +98,9 @@ func (s IPNet) StringSlice() []string {
}
// IsSuperset returns true if and only if s1 is a superset of s2.
-func (s1 IPNet) IsSuperset(s2 IPNet) bool {
+func (s IPNet) IsSuperset(s2 IPNet) bool {
for k := range s2 {
- _, found := s1[k]
+ _, found := s[k]
if !found {
return false
}
@@ -109,8 +111,8 @@ func (s1 IPNet) IsSuperset(s2 IPNet) bool {
// Equal returns true if and only if s1 is equal (as a set) to s2.
// Two sets are equal if their membership is identical.
// (In practice, this means same elements, order doesn't matter)
-func (s1 IPNet) Equal(s2 IPNet) bool {
- return len(s1) == len(s2) && s1.IsSuperset(s2)
+func (s IPNet) Equal(s2 IPNet) bool {
+ return len(s) == len(s2) && s.IsSuperset(s2)
}
// Len returns the size of the set.