From f9099f27e3d3f99914ba31f3cbd1bf033ac9e19c Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Wed, 17 Jul 2024 17:57:50 +0530 Subject: [PATCH] bundle: rename the operator package Signed-off-by: Nitin Goyal --- Makefile.Downstream.mk | 2 +- bundle.Dockerfile | 2 +- ...c.authorization.k8s.io_v1_clusterrole.yaml | 27 ++++++ ...c.authorization.k8s.io_v1_clusterrole.yaml | 23 +++++ ...c.authorization.k8s.io_v1_clusterrole.yaml | 27 ++++++ ...c.authorization.k8s.io_v1_clusterrole.yaml | 23 +++++ ...phcsi-operator.clusterserviceversion.yaml} | 38 +++++++- .../manifests/csi.ceph.io_cephclusters.yaml | 72 ++++++++++++++++ bundle/manifests/csi.ceph.io_configs.yaml | 86 +++++++++++++++++++ bundle/metadata/annotations.yaml | 2 +- config/crd/bases/csi.ceph.io_configs.yaml | 2 + ...phcsi-operator.clusterserviceversion.yaml} | 2 +- config/manifests/bases/kustomization.yaml | 2 +- 13 files changed, 300 insertions(+), 8 deletions(-) create mode 100644 bundle/manifests/ceph-csi-operator-cephcluster-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml create mode 100644 bundle/manifests/ceph-csi-operator-cephcluster-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml create mode 100644 bundle/manifests/ceph-csi-operator-config-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml create mode 100644 bundle/manifests/ceph-csi-operator-config-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml rename bundle/manifests/{ceph-csi-operator.clusterserviceversion.yaml => cephcsi-operator.clusterserviceversion.yaml} (87%) create mode 100644 bundle/manifests/csi.ceph.io_cephclusters.yaml create mode 100644 bundle/manifests/csi.ceph.io_configs.yaml rename config/manifests/bases/{ceph-csi-operator.clusterserviceversion.yaml => cephcsi-operator.clusterserviceversion.yaml} (96%) diff --git a/Makefile.Downstream.mk b/Makefile.Downstream.mk index eef5ff37..437ddfa7 100644 --- a/Makefile.Downstream.mk +++ b/Makefile.Downstream.mk @@ -7,7 +7,7 @@ BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(BUNDLE_IMAGE_NAME):$(IMA # the PACKAGE_NAME is included in the bundle/CSV and is used in catalogsources # for operators (like OperatorHub.io). Products that include the ceph-csi-operator # bundle should use a different PACKAGE_NAME to prevent conflicts. -PACKAGE_NAME ?= ceph-csi-operator +PACKAGE_NAME ?= cephcsi-operator # Creating the New CatalogSource requires publishing CSVs that replace one operator, # but can skip several. This can be accomplished using the skipRange annotation: diff --git a/bundle.Dockerfile b/bundle.Dockerfile index fc39157e..faad8206 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -4,7 +4,7 @@ FROM scratch LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ -LABEL operators.operatorframework.io.bundle.package.v1=ceph-csi-operator +LABEL operators.operatorframework.io.bundle.package.v1=cephcsi-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 diff --git a/bundle/manifests/ceph-csi-operator-cephcluster-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/ceph-csi-operator-cephcluster-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000..b4cb1d51 --- /dev/null +++ b/bundle/manifests/ceph-csi-operator-cephcluster-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,27 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: ceph-csi-operator + name: ceph-csi-operator-cephcluster-editor-role +rules: +- apiGroups: + - csi.ceph.io + resources: + - cephclusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - csi.ceph.io + resources: + - cephclusters/status + verbs: + - get diff --git a/bundle/manifests/ceph-csi-operator-cephcluster-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/ceph-csi-operator-cephcluster-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000..e96a4b20 --- /dev/null +++ b/bundle/manifests/ceph-csi-operator-cephcluster-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,23 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: ceph-csi-operator + name: ceph-csi-operator-cephcluster-viewer-role +rules: +- apiGroups: + - csi.ceph.io + resources: + - cephclusters + verbs: + - get + - list + - watch +- apiGroups: + - csi.ceph.io + resources: + - cephclusters/status + verbs: + - get diff --git a/bundle/manifests/ceph-csi-operator-config-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/ceph-csi-operator-config-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000..1ad9fc2f --- /dev/null +++ b/bundle/manifests/ceph-csi-operator-config-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,27 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: ceph-csi-operator + name: ceph-csi-operator-config-editor-role +rules: +- apiGroups: + - csi.ceph.io + resources: + - configs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - csi.ceph.io + resources: + - configs/status + verbs: + - get diff --git a/bundle/manifests/ceph-csi-operator-config-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/ceph-csi-operator-config-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000..4e226085 --- /dev/null +++ b/bundle/manifests/ceph-csi-operator-config-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,23 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: ceph-csi-operator + name: ceph-csi-operator-config-viewer-role +rules: +- apiGroups: + - csi.ceph.io + resources: + - configs + verbs: + - get + - list + - watch +- apiGroups: + - csi.ceph.io + resources: + - configs/status + verbs: + - get diff --git a/bundle/manifests/ceph-csi-operator.clusterserviceversion.yaml b/bundle/manifests/cephcsi-operator.clusterserviceversion.yaml similarity index 87% rename from bundle/manifests/ceph-csi-operator.clusterserviceversion.yaml rename to bundle/manifests/cephcsi-operator.clusterserviceversion.yaml index 8ff17c76..0f58bffe 100644 --- a/bundle/manifests/ceph-csi-operator.clusterserviceversion.yaml +++ b/bundle/manifests/cephcsi-operator.clusterserviceversion.yaml @@ -4,17 +4,23 @@ metadata: annotations: alm-examples: '[]' capabilities: Basic Install - createdAt: "2024-07-04T14:02:29Z" + createdAt: "2024-07-17T12:27:29Z" olm.skipRange: "" operators.operatorframework.io/builder: operator-sdk-v1.34.1 operators.operatorframework.io/operator-type: non-standalone operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 - name: ceph-csi-operator.v4.17.0 + name: cephcsi-operator.v4.17.0 namespace: placeholder spec: apiservicedefinitions: {} customresourcedefinitions: owned: + - kind: CephCluster + name: cephclusters.csi.ceph.io + version: v1alpha1 + - kind: Config + name: configs.csi.ceph.io + version: v1alpha1 - kind: Driver name: drivers.csi.ceph.io version: v1alpha1 @@ -30,6 +36,32 @@ spec: spec: clusterPermissions: - rules: + - apiGroups: + - csi.ceph.io + resources: + - configs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - csi.ceph.io + resources: + - configs/finalizers + verbs: + - update + - apiGroups: + - csi.ceph.io + resources: + - configs/status + verbs: + - get + - patch + - update - apiGroups: - csi.ceph.io resources: @@ -118,7 +150,7 @@ spec: - --leader-elect command: - /manager - image: quay.io/cephcsi/ceph-csi-operator:latest + image: quay.io/ocs-dev/ceph-csi-operator:latest livenessProbe: httpGet: path: /healthz diff --git a/bundle/manifests/csi.ceph.io_cephclusters.yaml b/bundle/manifests/csi.ceph.io_cephclusters.yaml new file mode 100644 index 00000000..51707a50 --- /dev/null +++ b/bundle/manifests/csi.ceph.io_cephclusters.yaml @@ -0,0 +1,72 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: cephclusters.csi.ceph.io +spec: + group: csi.ceph.io + names: + kind: CephCluster + listKind: CephClusterList + plural: cephclusters + singular: cephcluster + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: CephCluster is the Schema for the cephclusters API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: CephClusterSpec defines the desired state of CephCluster + properties: + monitors: + items: + type: string + type: array + rbdMirrorDaemonCount: + type: integer + readAffinity: + description: ReadAffinitySpec capture Ceph CSI read affinity settings + properties: + crushLocationLabels: + items: + type: string + type: array + type: object + required: + - monitors + type: object + status: + description: CephClusterStatus defines the observed state of CephCluster + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/bundle/manifests/csi.ceph.io_configs.yaml b/bundle/manifests/csi.ceph.io_configs.yaml new file mode 100644 index 00000000..85548ffe --- /dev/null +++ b/bundle/manifests/csi.ceph.io_configs.yaml @@ -0,0 +1,86 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: configs.csi.ceph.io +spec: + group: csi.ceph.io + names: + kind: Config + listKind: ConfigList + plural: configs + singular: config + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Config is the Schema for the configs API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ConfigSpec defines the desired state of Config + properties: + cephClusterRef: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? + type: string + type: object + x-kubernetes-map-type: atomic + cephFs: + description: CephFsConfigSpec defines the desired CephFs configuration + properties: + subVolumeGroup: + type: string + type: object + nfs: + description: NfsConfigSpec cdefines the desired NFS configuration + type: object + rbd: + description: RbdConfigSpec defines the desired RBD configuration + properties: + radosNamespace: + type: string + type: object + required: + - cephClusterRef + type: object + status: + description: ConfigStatus defines the observed state of Config + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 5f5e02a2..7234fb5f 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -3,7 +3,7 @@ annotations: operators.operatorframework.io.bundle.mediatype.v1: registry+v1 operators.operatorframework.io.bundle.manifests.v1: manifests/ operators.operatorframework.io.bundle.metadata.v1: metadata/ - operators.operatorframework.io.bundle.package.v1: ceph-csi-operator + operators.operatorframework.io.bundle.package.v1: cephcsi-operator operators.operatorframework.io.bundle.channels.v1: alpha operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.1 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 diff --git a/config/crd/bases/csi.ceph.io_configs.yaml b/config/crd/bases/csi.ceph.io_configs.yaml index dc890f6e..7781fc9b 100644 --- a/config/crd/bases/csi.ceph.io_configs.yaml +++ b/config/crd/bases/csi.ceph.io_configs.yaml @@ -67,6 +67,8 @@ spec: radosNamespace: type: string type: object + required: + - cephClusterRef type: object status: description: ConfigStatus defines the observed state of Config diff --git a/config/manifests/bases/ceph-csi-operator.clusterserviceversion.yaml b/config/manifests/bases/cephcsi-operator.clusterserviceversion.yaml similarity index 96% rename from config/manifests/bases/ceph-csi-operator.clusterserviceversion.yaml rename to config/manifests/bases/cephcsi-operator.clusterserviceversion.yaml index ef8eb23f..a072b2d7 100644 --- a/config/manifests/bases/ceph-csi-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cephcsi-operator.clusterserviceversion.yaml @@ -6,7 +6,7 @@ metadata: capabilities: Basic Install olm.skipRange: "" operators.operatorframework.io/operator-type: non-standalone - name: ceph-csi-operator.v0.1.1 + name: cephcsi-operator.v0.1.1 namespace: placeholder spec: apiservicedefinitions: {} diff --git a/config/manifests/bases/kustomization.yaml b/config/manifests/bases/kustomization.yaml index 613c7ba1..c6cf9f95 100644 --- a/config/manifests/bases/kustomization.yaml +++ b/config/manifests/bases/kustomization.yaml @@ -1,6 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- ceph-csi-operator.clusterserviceversion.yaml +- cephcsi-operator.clusterserviceversion.yaml commonAnnotations: olm.skipRange: ""