Skip to content

Commit e6fbb59

Browse files
author
Han Kang
committed
move framework files to subdirectory for isolation
1 parent 7f99706 commit e6fbb59

File tree

11 files changed

+73
-35
lines changed

11 files changed

+73
-35
lines changed

pkg/util/metrics/BUILD

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,20 @@ load(
88

99
go_library(
1010
name = "go_default_library",
11-
srcs = [
12-
"counter.go",
13-
"metric.go",
14-
"opts.go",
15-
"registry.go",
16-
"util.go",
17-
"version_parser.go",
18-
"wrappers.go",
19-
],
11+
srcs = ["util.go"],
2012
importpath = "k8s.io/kubernetes/pkg/util/metrics",
2113
deps = [
22-
"//pkg/version:go_default_library",
23-
"//staging/src/k8s.io/apimachinery/pkg/version:go_default_library",
2414
"//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library",
25-
"//vendor/github.com/blang/semver:go_default_library",
2615
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
27-
"//vendor/github.com/prometheus/client_model/go:go_default_library",
28-
"//vendor/k8s.io/klog:go_default_library",
2916
],
3017
)
3118

3219
go_test(
3320
name = "go_default_test",
34-
srcs = [
35-
"counter_test.go",
36-
"registry_test.go",
37-
"util_test.go",
38-
"version_parser_test.go",
39-
],
21+
srcs = ["util_test.go"],
4022
embed = [":go_default_library"],
4123
deps = [
42-
"//staging/src/k8s.io/apimachinery/pkg/version:go_default_library",
4324
"//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library",
44-
"//vendor/github.com/blang/semver:go_default_library",
45-
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
46-
"//vendor/github.com/prometheus/common/expfmt:go_default_library",
47-
"//vendor/github.com/stretchr/testify/assert:go_default_library",
4825
],
4926
)
5027

@@ -57,6 +34,9 @@ filegroup(
5734

5835
filegroup(
5936
name = "all-srcs",
60-
srcs = [":package-srcs"],
37+
srcs = [
38+
":package-srcs",
39+
"//pkg/util/metrics/framework:all-srcs",
40+
],
6141
tags = ["automanaged"],
6242
)

pkg/util/metrics/framework/BUILD

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load(
4+
"@io_bazel_rules_go//go:def.bzl",
5+
"go_library",
6+
"go_test",
7+
)
8+
9+
go_library(
10+
name = "go_default_library",
11+
srcs = [
12+
"counter.go",
13+
"metric.go",
14+
"opts.go",
15+
"registry.go",
16+
"version_parser.go",
17+
"wrappers.go",
18+
],
19+
importpath = "k8s.io/kubernetes/pkg/util/metrics/framework",
20+
deps = [
21+
"//pkg/version:go_default_library",
22+
"//staging/src/k8s.io/apimachinery/pkg/version:go_default_library",
23+
"//vendor/github.com/blang/semver:go_default_library",
24+
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
25+
"//vendor/github.com/prometheus/client_model/go:go_default_library",
26+
"//vendor/k8s.io/klog:go_default_library",
27+
],
28+
)
29+
30+
go_test(
31+
name = "go_default_test",
32+
srcs = [
33+
"counter_test.go",
34+
"registry_test.go",
35+
"version_parser_test.go",
36+
],
37+
embed = [":go_default_library"],
38+
deps = [
39+
"//staging/src/k8s.io/apimachinery/pkg/version:go_default_library",
40+
"//vendor/github.com/blang/semver:go_default_library",
41+
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
42+
"//vendor/github.com/prometheus/common/expfmt:go_default_library",
43+
"//vendor/github.com/stretchr/testify/assert:go_default_library",
44+
],
45+
)
46+
47+
filegroup(
48+
name = "package-srcs",
49+
srcs = glob(["**"]),
50+
tags = ["automanaged"],
51+
visibility = ["//visibility:private"],
52+
)
53+
54+
filegroup(
55+
name = "all-srcs",
56+
srcs = [":package-srcs"],
57+
tags = ["automanaged"],
58+
)

pkg/util/metrics/counter.go renamed to pkg/util/metrics/framework/counter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"github.com/blang/semver"

pkg/util/metrics/counter_test.go renamed to pkg/util/metrics/framework/counter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"bytes"

pkg/util/metrics/metric.go renamed to pkg/util/metrics/framework/metric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"github.com/blang/semver"

pkg/util/metrics/opts.go renamed to pkg/util/metrics/framework/opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"fmt"

pkg/util/metrics/registry.go renamed to pkg/util/metrics/framework/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"github.com/blang/semver"

pkg/util/metrics/registry_test.go renamed to pkg/util/metrics/framework/registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"github.com/blang/semver"

pkg/util/metrics/version_parser.go renamed to pkg/util/metrics/framework/version_parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
"fmt"

pkg/util/metrics/version_parser_test.go renamed to pkg/util/metrics/framework/version_parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package metrics
17+
package framework
1818

1919
import (
2020
apimachineryversion "k8s.io/apimachinery/pkg/version"

0 commit comments

Comments
 (0)