From 2226738e692d0b316e93149e05f6e4df94a1fa50 Mon Sep 17 00:00:00 2001 From: yangk Date: Thu, 12 Jan 2023 14:48:46 +0800 Subject: [PATCH] perf: set rbdability and rbdplugin as cluster resources --- Makefile | 2 +- config/crd/rainbond.io_rbdabilities.yaml | 2 +- config/crd/rainbond.io_rbdplugins.yaml | 2 +- pkg/apis/rainbond/v1alpha1/rbdability_types.go | 1 + pkg/apis/rainbond/v1alpha1/rbdplugin_types.go | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index eae508844..879a2ce21 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ CRD_OPTIONS ?= "crd:trivialVersions=true" manifests: controller-gen $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./pkg/apis/..." output:crd:artifacts:config=config/crd -# Generate code +# Generate code, controller-gen version: v0.9.2 generate: controller-gen chmod +x vendor/k8s.io/code-generator/generate-groups.sh ./hack/k8s/codegen/update-generated.sh diff --git a/config/crd/rainbond.io_rbdabilities.yaml b/config/crd/rainbond.io_rbdabilities.yaml index f28995e16..a95a3df41 100644 --- a/config/crd/rainbond.io_rbdabilities.yaml +++ b/config/crd/rainbond.io_rbdabilities.yaml @@ -14,7 +14,7 @@ spec: listKind: RBDAbilityList plural: rbdabilities singular: rbdability - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/config/crd/rainbond.io_rbdplugins.yaml b/config/crd/rainbond.io_rbdplugins.yaml index 85ed5dad4..e79a6acee 100644 --- a/config/crd/rainbond.io_rbdplugins.yaml +++ b/config/crd/rainbond.io_rbdplugins.yaml @@ -14,7 +14,7 @@ spec: listKind: RBDPluginList plural: rbdplugins singular: rbdplugin - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/pkg/apis/rainbond/v1alpha1/rbdability_types.go b/pkg/apis/rainbond/v1alpha1/rbdability_types.go index b1caba1aa..8b31bbf30 100644 --- a/pkg/apis/rainbond/v1alpha1/rbdability_types.go +++ b/pkg/apis/rainbond/v1alpha1/rbdability_types.go @@ -51,6 +51,7 @@ type RBDAbilityStatus struct { // +genclient //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:scope=Cluster // RBDAbility is the Schema for the rbdplugins API type RBDAbility struct { diff --git a/pkg/apis/rainbond/v1alpha1/rbdplugin_types.go b/pkg/apis/rainbond/v1alpha1/rbdplugin_types.go index f591b0bbd..b74f61bd4 100644 --- a/pkg/apis/rainbond/v1alpha1/rbdplugin_types.go +++ b/pkg/apis/rainbond/v1alpha1/rbdplugin_types.go @@ -46,6 +46,7 @@ type RBDPluginStatus struct { // +genclient //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:scope=Cluster // RBDPlugin is the Schema for the rbdplugins API type RBDPlugin struct {