Restrict visibility of prometheus to enforce usage of k8s.io/component-base/metrics

This commit is contained in:
Marek Siarkowicz
2019-10-24 18:06:26 +02:00
parent 73b2c82b28
commit e7d5659943
12 changed files with 43 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus",
importpath = "github.com/prometheus/client_golang/prometheus",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = [
"//vendor/github.com/beorn7/perks/quantile:go_default_library",
"//vendor/github.com/golang/protobuf/proto:go_default_library",

View File

@@ -5,7 +5,7 @@ go_library(
srcs = ["metric.go"],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus/internal",
importpath = "github.com/prometheus/client_golang/prometheus/internal",
visibility = ["//vendor/github.com/prometheus/client_golang/prometheus:__subpackages__"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = ["//vendor/github.com/prometheus/client_model/go:go_default_library"],
)

View File

@@ -10,7 +10,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus/promhttp",
importpath = "github.com/prometheus/client_golang/prometheus/promhttp",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = [
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
"//vendor/github.com/prometheus/client_model/go:go_default_library",

View File

@@ -5,7 +5,7 @@ go_library(
srcs = ["testutil.go"],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus/testutil",
importpath = "github.com/prometheus/client_golang/prometheus/testutil",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = [
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
"//vendor/github.com/prometheus/client_golang/prometheus/internal:go_default_library",

View File

@@ -5,7 +5,7 @@ go_library(
srcs = ["metrics.pb.go"],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/client_model/go",
importpath = "github.com/prometheus/client_model/go",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = ["//vendor/github.com/golang/protobuf/proto:go_default_library"],
)

View File

@@ -11,7 +11,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/common/expfmt",
importpath = "github.com/prometheus/common/expfmt",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = [
"//vendor/github.com/golang/protobuf/proto:go_default_library",
"//vendor/github.com/matttproud/golang_protobuf_extensions/pbutil:go_default_library",

View File

@@ -5,7 +5,7 @@ go_library(
srcs = ["autoneg.go"],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg",
importpath = "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg",
visibility = ["//vendor/github.com/prometheus/common:__subpackages__"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
)
filegroup(

View File

@@ -17,7 +17,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/common/model",
importpath = "github.com/prometheus/common/model",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
)
filegroup(

View File

@@ -23,7 +23,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/procfs",
importpath = "github.com/prometheus/procfs",
visibility = ["//visibility:public"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
deps = ["//vendor/github.com/prometheus/procfs/internal/fs:go_default_library"],
)

View File

@@ -5,7 +5,7 @@ go_library(
srcs = ["fs.go"],
importmap = "k8s.io/kubernetes/vendor/github.com/prometheus/procfs/internal/fs",
importpath = "github.com/prometheus/procfs/internal/fs",
visibility = ["//vendor/github.com/prometheus/procfs:__subpackages__"],
visibility = ["//staging/src/k8s.io/component-base/metrics:prometheus_import_allow_list"],
)
filegroup(