From a0c57b36d6601d069df4693764b104a519935c6a Mon Sep 17 00:00:00 2001 From: Phoeniix Zhao Date: Fri, 12 Jan 2024 17:50:51 +0800 Subject: [PATCH] refactor: rename api group from xline.kvstore.datenlord.com to xline.io.datenlord.com Signed-off-by: Phoeniix Zhao --- PROJECT | 4 ++-- api/v1alpha1/groupversion_info.go | 4 ++-- cmd/main.go | 2 +- ...sters.yaml => xline.io.datenlord.com_xlineclusters.yaml} | 4 ++-- config/crd/kustomization.yaml | 2 +- config/rbac/role.yaml | 6 +++--- config/rbac/xlinecluster_editor_role.yaml | 4 ++-- config/rbac/xlinecluster_viewer_role.yaml | 4 ++-- config/samples/_v1alpha1_xlinecluster.yaml | 2 +- internal/controller/xlinecluster_controller.go | 6 +++--- internal/controller/xlinecluster_controller_test.go | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) rename config/crd/bases/{xline.kvstore.datenlord.com_xlineclusters.yaml => xline.io.datenlord.com_xlineclusters.yaml} (98%) diff --git a/PROJECT b/PROJECT index 42ba47c5..503ee867 100644 --- a/PROJECT +++ b/PROJECT @@ -2,7 +2,7 @@ # This file is used to track the info used to scaffold your project # and allow the plugins properly work. # More info: https://book.kubebuilder.io/reference/project-config.html -domain: xline.kvstore.datenlord.com +domain: xline.io.datenlord.com layout: - go.kubebuilder.io/v4 projectName: xline-operator @@ -12,7 +12,7 @@ resources: crdVersion: v1 namespaced: true controller: true - domain: xline.kvstore.datenlord.com + domain: xline.io.datenlord.com kind: XlineCluster path: github.com/xline-kv/xline-operator/api/v1alpha1 version: v1alpha1 diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index c3ffd941..818492c3 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -16,7 +16,7 @@ limitations under the License. // Package v1alpha1 contains API Schema definitions for the v1alpha1 API group // +kubebuilder:object:generate=true -// +groupName=xline.kvstore.datenlord.com +// +groupName=xline.io.datenlord.com package v1alpha1 import ( @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "xline.kvstore.datenlord.com", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "xline.io.datenlord.com", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/cmd/main.go b/cmd/main.go index 86292f5f..119bdcc1 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -71,7 +71,7 @@ func main() { Metrics: metricsserver.Options{BindAddress: metricsAddr}, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "8f6ca976.xline.kvstore.datenlord.com", + LeaderElectionID: "8f6ca976.xline.io.datenlord.com", // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly diff --git a/config/crd/bases/xline.kvstore.datenlord.com_xlineclusters.yaml b/config/crd/bases/xline.io.datenlord.com_xlineclusters.yaml similarity index 98% rename from config/crd/bases/xline.kvstore.datenlord.com_xlineclusters.yaml rename to config/crd/bases/xline.io.datenlord.com_xlineclusters.yaml index 04f711a2..2b0dac5b 100644 --- a/config/crd/bases/xline.kvstore.datenlord.com_xlineclusters.yaml +++ b/config/crd/bases/xline.io.datenlord.com_xlineclusters.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: xlineclusters.xline.kvstore.datenlord.com + name: xlineclusters.xline.io.datenlord.com spec: - group: xline.kvstore.datenlord.com + group: xline.io.datenlord.com names: kind: XlineCluster listKind: XlineClusterList diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 1369689a..7bd8ee5d 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -2,7 +2,7 @@ # since it depends on service name and namespace that are out of this kustomize package. # It should be run by config/default resources: -- bases/xline.kvstore.datenlord.com_xlineclusters.yaml +- bases/xline.io.datenlord.com_xlineclusters.yaml #+kubebuilder:scaffold:crdkustomizeresource patches: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index b6f38d8f..f408b99c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -37,7 +37,7 @@ rules: - update - watch - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters verbs: @@ -49,13 +49,13 @@ rules: - update - watch - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters/finalizers verbs: - update - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters/status verbs: diff --git a/config/rbac/xlinecluster_editor_role.yaml b/config/rbac/xlinecluster_editor_role.yaml index c989f97c..8a90a07f 100644 --- a/config/rbac/xlinecluster_editor_role.yaml +++ b/config/rbac/xlinecluster_editor_role.yaml @@ -12,7 +12,7 @@ metadata: name: xlinecluster-editor-role rules: - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters verbs: @@ -24,7 +24,7 @@ rules: - update - watch - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters/status verbs: diff --git a/config/rbac/xlinecluster_viewer_role.yaml b/config/rbac/xlinecluster_viewer_role.yaml index 21db288a..add57723 100644 --- a/config/rbac/xlinecluster_viewer_role.yaml +++ b/config/rbac/xlinecluster_viewer_role.yaml @@ -12,7 +12,7 @@ metadata: name: xlinecluster-viewer-role rules: - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters verbs: @@ -20,7 +20,7 @@ rules: - list - watch - apiGroups: - - xline.kvstore.datenlord.com + - xline.io.datenlord.com resources: - xlineclusters/status verbs: diff --git a/config/samples/_v1alpha1_xlinecluster.yaml b/config/samples/_v1alpha1_xlinecluster.yaml index 620369c5..21818a12 100644 --- a/config/samples/_v1alpha1_xlinecluster.yaml +++ b/config/samples/_v1alpha1_xlinecluster.yaml @@ -1,4 +1,4 @@ -apiVersion: xline.kvstore.datenlord.com/v1alpha1 +apiVersion: xline.io.datenlord.com/v1alpha1 kind: XlineCluster metadata: labels: diff --git a/internal/controller/xlinecluster_controller.go b/internal/controller/xlinecluster_controller.go index bc4c887c..ec0e26cf 100644 --- a/internal/controller/xlinecluster_controller.go +++ b/internal/controller/xlinecluster_controller.go @@ -34,9 +34,9 @@ type XlineClusterReconciler struct { Scheme *runtime.Scheme } -//+kubebuilder:rbac:groups=xline.kvstore.datenlord.com,resources=xlineclusters,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=xline.kvstore.datenlord.com,resources=xlineclusters/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=xline.kvstore.datenlord.com,resources=xlineclusters/finalizers,verbs=update +//+kubebuilder:rbac:groups=xline.io.datenlord.com,resources=xlineclusters,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=xline.io.datenlord.com,resources=xlineclusters/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=xline.io.datenlord.com,resources=xlineclusters/finalizers,verbs=update //+kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch diff --git a/internal/controller/xlinecluster_controller_test.go b/internal/controller/xlinecluster_controller_test.go index b8747c30..7528654a 100644 --- a/internal/controller/xlinecluster_controller_test.go +++ b/internal/controller/xlinecluster_controller_test.go @@ -61,7 +61,7 @@ var _ = Describe("XlineCluster controller", func() { image := "test-image:latest" xlineCluster := &xapi.XlineCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: "xline.kvstore.datenlord.com/v1alpha1", + APIVersion: "xline.io.datenlord.com/v1alpha1", Kind: "XlineCluster", }, ObjectMeta: metav1.ObjectMeta{