Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused sub-pkgs in pkg/util #48410

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 1 addition & 13 deletions hack/.linted_packages
Expand Up @@ -258,33 +258,21 @@ pkg/security/podsecuritypolicy/sysctl
pkg/serviceaccount
pkg/types
pkg/util/async
pkg/util/errors
pkg/util/flock
pkg/util/framer
pkg/util/goroutinemap
pkg/util/hash
pkg/util/i18n
pkg/util/interrupt
pkg/util/intstr
pkg/util/io
pkg/util/json
pkg/util/limitwriter
pkg/util/logs
pkg/util/maps
pkg/util/metrics
pkg/util/net
pkg/util/net/sets
pkg/util/netsh
pkg/util/rand
pkg/util/runtime
pkg/util/sets
pkg/util/sets/types
pkg/util/slice
pkg/util/tail
pkg/util/validation
pkg/util/validation/field
pkg/util/version
pkg/util/wait
pkg/util/yaml
pkg/version/prometheus
pkg/volume
pkg/volume/downwardapi
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-generated-protobuf.sh
Expand Up @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env

APIROOTS=${APIROOTS:-pkg/api pkg/apis pkg/runtime pkg/util/intstr pkg/watch staging/src/k8s.io/apimachinery/pkg/api staging/src/k8s.io/apimachinery/pkg/apis staging/src/k8s.io/apiserver/pkg staging/src/k8s.io/api staging/src/k8s.io/metrics/pkg/apis}
APIROOTS=${APIROOTS:-pkg/api pkg/apis pkg/runtime pkg/watch staging/src/k8s.io/apimachinery/pkg/api staging/src/k8s.io/apimachinery/pkg/apis staging/src/k8s.io/apiserver/pkg staging/src/k8s.io/api staging/src/k8s.io/metrics/pkg/apis}
_tmp="${KUBE_ROOT}/_tmp"

cleanup() {
Expand Down
11 changes: 0 additions & 11 deletions pkg/util/BUILD
Expand Up @@ -50,20 +50,16 @@ filegroup(
"//pkg/util/dbus:all-srcs",
"//pkg/util/ebtables:all-srcs",
"//pkg/util/env:all-srcs",
"//pkg/util/errors:all-srcs",
"//pkg/util/exec:all-srcs",
"//pkg/util/flock:all-srcs",
"//pkg/util/framer:all-srcs",
"//pkg/util/goroutinemap:all-srcs",
"//pkg/util/hash:all-srcs",
"//pkg/util/i18n:all-srcs",
"//pkg/util/initsystem:all-srcs",
"//pkg/util/interrupt:all-srcs",
"//pkg/util/intstr:all-srcs",
"//pkg/util/io:all-srcs",
"//pkg/util/ipconfig:all-srcs",
"//pkg/util/iptables:all-srcs",
"//pkg/util/json:all-srcs",
"//pkg/util/keymutex:all-srcs",
"//pkg/util/labels:all-srcs",
"//pkg/util/limitwriter:all-srcs",
Expand All @@ -77,13 +73,10 @@ filegroup(
"//pkg/util/oom:all-srcs",
"//pkg/util/parsers:all-srcs",
"//pkg/util/procfs:all-srcs",
"//pkg/util/rand:all-srcs",
"//pkg/util/removeall:all-srcs",
"//pkg/util/resourcecontainer:all-srcs",
"//pkg/util/rlimit:all-srcs",
"//pkg/util/runtime:all-srcs",
"//pkg/util/selinux:all-srcs",
"//pkg/util/sets:all-srcs",
"//pkg/util/slice:all-srcs",
"//pkg/util/strings:all-srcs",
"//pkg/util/sysctl:all-srcs",
Expand All @@ -92,12 +85,8 @@ filegroup(
"//pkg/util/taints:all-srcs",
"//pkg/util/threading:all-srcs",
"//pkg/util/tolerations:all-srcs",
"//pkg/util/uuid:all-srcs",
"//pkg/util/validation:all-srcs",
"//pkg/util/version:all-srcs",
"//pkg/util/wait:all-srcs",
"//pkg/util/workqueue/prometheus:all-srcs",
"//pkg/util/yaml:all-srcs",
],
tags = ["automanaged"],
)
27 changes: 0 additions & 27 deletions pkg/util/errors/BUILD

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/util/errors/doc.go

This file was deleted.

27 changes: 0 additions & 27 deletions pkg/util/framer/BUILD

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/util/framer/doc.go

This file was deleted.

27 changes: 0 additions & 27 deletions pkg/util/intstr/BUILD

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/util/intstr/doc.go

This file was deleted.

27 changes: 0 additions & 27 deletions pkg/util/json/BUILD

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/util/json/doc.go

This file was deleted.

11 changes: 0 additions & 11 deletions pkg/util/net/BUILD
Expand Up @@ -2,17 +2,6 @@ package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)

go_library(
name = "go_default_library",
srcs = ["doc.go"],
tags = ["automanaged"],
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
Expand Down
21 changes: 0 additions & 21 deletions pkg/util/net/doc.go

This file was deleted.

10 changes: 6 additions & 4 deletions pkg/util/net/sets/ipnet.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand All @@ -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.
Expand Down
27 changes: 0 additions & 27 deletions pkg/util/rand/BUILD

This file was deleted.