From e0915882d94569a8d9764c44796969b8572b87b9 Mon Sep 17 00:00:00 2001 From: Arnon Gilboa Date: Sun, 24 Apr 2022 18:43:50 +0300 Subject: [PATCH] Expose all CDI CRDs to cluster-readers Signed-off-by: Arnon Gilboa --- cmd/cdi-cloner/BUILD.bazel | 1 + pkg/controller/BUILD.bazel | 1 + pkg/image/BUILD.bazel | 1 + pkg/importer/BUILD.bazel | 1 + pkg/operator/controller/BUILD.bazel | 1 + pkg/operator/resources/cluster/rbac.go | 5 +++++ tests/rbac_test.go | 5 +++++ tools/metricsdocs/BUILD.bazel | 2 +- 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/cdi-cloner/BUILD.bazel b/cmd/cdi-cloner/BUILD.bazel index 088d8c0454..be84a112e7 100644 --- a/cmd/cdi-cloner/BUILD.bazel +++ b/cmd/cdi-cloner/BUILD.bazel @@ -9,6 +9,7 @@ go_library( visibility = ["//visibility:private"], deps = [ "//pkg/common:go_default_library", + "//pkg/monitoring:go_default_library", "//pkg/util:go_default_library", "//pkg/util/prometheus:go_default_library", "//vendor/github.com/golang/snappy:go_default_library", diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel index 5c0cb1586d..a5caf61da8 100644 --- a/pkg/controller/BUILD.bazel +++ b/pkg/controller/BUILD.bazel @@ -22,6 +22,7 @@ go_library( deps = [ "//pkg/common:go_default_library", "//pkg/feature-gates:go_default_library", + "//pkg/monitoring:go_default_library", "//pkg/operator:go_default_library", "//pkg/storagecapabilities:go_default_library", "//pkg/token:go_default_library", diff --git a/pkg/image/BUILD.bazel b/pkg/image/BUILD.bazel index 64906c5a73..800b39503d 100644 --- a/pkg/image/BUILD.bazel +++ b/pkg/image/BUILD.bazel @@ -12,6 +12,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/common:go_default_library", + "//pkg/monitoring:go_default_library", "//pkg/system:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/docker/go-units:go_default_library", diff --git a/pkg/importer/BUILD.bazel b/pkg/importer/BUILD.bazel index 1b30c85f77..4683ef1f21 100644 --- a/pkg/importer/BUILD.bazel +++ b/pkg/importer/BUILD.bazel @@ -20,6 +20,7 @@ go_library( deps = [ "//pkg/common:go_default_library", "//pkg/image:go_default_library", + "//pkg/monitoring:go_default_library", "//pkg/util:go_default_library", "//pkg/util/prometheus:go_default_library", "//staging/src/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1:go_default_library", diff --git a/pkg/operator/controller/BUILD.bazel b/pkg/operator/controller/BUILD.bazel index 3fa33ab90f..ad51ef0cef 100644 --- a/pkg/operator/controller/BUILD.bazel +++ b/pkg/operator/controller/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//pkg/apiserver:go_default_library", "//pkg/common:go_default_library", "//pkg/controller:go_default_library", + "//pkg/monitoring:go_default_library", "//pkg/operator:go_default_library", "//pkg/operator/resources/cert:go_default_library", "//pkg/operator/resources/cluster:go_default_library", diff --git a/pkg/operator/resources/cluster/rbac.go b/pkg/operator/resources/cluster/rbac.go index 09bc842ae1..a5d21ef870 100644 --- a/pkg/operator/resources/cluster/rbac.go +++ b/pkg/operator/resources/cluster/rbac.go @@ -85,7 +85,12 @@ func getViewPolicyRules() []rbacv1.PolicyRule { "cdi.kubevirt.io", }, Resources: []string{ + "cdiconfigs", + "dataimportcrons", + "datasources", "datavolumes", + "objecttransfers", + "storageprofiles", }, Verbs: []string{ "get", diff --git a/tests/rbac_test.go b/tests/rbac_test.go index 600f8123bd..e2ec0dcc0e 100644 --- a/tests/rbac_test.go +++ b/tests/rbac_test.go @@ -255,7 +255,12 @@ var _ = Describe("Aggregated role definition tests", func() { "cdi.kubevirt.io", }, Resources: []string{ + "cdiconfigs", + "dataimportcrons", + "datasources", "datavolumes", + "objecttransfers", + "storageprofiles", }, Verbs: []string{ "get", diff --git a/tools/metricsdocs/BUILD.bazel b/tools/metricsdocs/BUILD.bazel index 91a894e6a5..f598f3d4af 100644 --- a/tools/metricsdocs/BUILD.bazel +++ b/tools/metricsdocs/BUILD.bazel @@ -5,7 +5,7 @@ go_library( srcs = ["metricsdocs.go"], importpath = "kubevirt.io/containerized-data-importer/tools/metricsdocs", visibility = ["//visibility:private"], - deps = ["//pkg/operator/controller:go_default_library"], + deps = ["//pkg/monitoring:go_default_library"], ) go_binary(