diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index 09d3b9da1..dae49adf1 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -36,9 +36,15 @@ spec: blockPoolName: description: BlockPoolName is the name of Ceph BlockPool. Typically it's the name of the CephBlockPool CR. type: string + x-kubernetes-validations: + - message: blockPoolName is immutable + rule: self == oldSelf name: description: The name of the CephBlockPoolRadosNamespaceSpec namespace. If not set, the default is the name of the CR. type: string + x-kubernetes-validations: + - message: name is immutable + rule: self == oldSelf required: - blockPoolName type: object @@ -7987,9 +7993,15 @@ spec: filesystemName: description: FilesystemName is the name of Ceph Filesystem SubVolumeGroup volume name. Typically it's the name of the CephFilesystem CR. If not coming from the CephFilesystem CR, it can be retrieved from the list of Ceph Filesystem volumes with `ceph fs volume ls`. To learn more about Ceph Filesystem abstractions see https://docs.ceph.com/en/latest/cephfs/fs-volumes/#fs-volumes-and-subvolumes type: string + x-kubernetes-validations: + - message: filesystemName is immutable + rule: self == oldSelf name: description: The name of the subvolume group. If not set, the default is the name of the subvolumeGroup CR. type: string + x-kubernetes-validations: + - message: name is immutable + rule: self == oldSelf pinning: description: Pinning configuration of CephFilesystemSubVolumeGroup, reference https://docs.ceph.com/en/latest/cephfs/fs-volumes/#pinning-subvolumes-and-subvolume-groups only one out of (export, distributed, random) can be set at a time properties: diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index 439eeed9a..fa232557c 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -39,9 +39,15 @@ spec: blockPoolName: description: BlockPoolName is the name of Ceph BlockPool. Typically it's the name of the CephBlockPool CR. type: string + x-kubernetes-validations: + - message: blockPoolName is immutable + rule: self == oldSelf name: description: The name of the CephBlockPoolRadosNamespaceSpec namespace. If not set, the default is the name of the CR. type: string + x-kubernetes-validations: + - message: name is immutable + rule: self == oldSelf required: - blockPoolName type: object @@ -7981,9 +7987,15 @@ spec: filesystemName: description: FilesystemName is the name of Ceph Filesystem SubVolumeGroup volume name. Typically it's the name of the CephFilesystem CR. If not coming from the CephFilesystem CR, it can be retrieved from the list of Ceph Filesystem volumes with `ceph fs volume ls`. To learn more about Ceph Filesystem abstractions see https://docs.ceph.com/en/latest/cephfs/fs-volumes/#fs-volumes-and-subvolumes type: string + x-kubernetes-validations: + - message: filesystemName is immutable + rule: self == oldSelf name: description: The name of the subvolume group. If not set, the default is the name of the subvolumeGroup CR. type: string + x-kubernetes-validations: + - message: name is immutable + rule: self == oldSelf pinning: description: Pinning configuration of CephFilesystemSubVolumeGroup, reference https://docs.ceph.com/en/latest/cephfs/fs-volumes/#pinning-subvolumes-and-subvolume-groups only one out of (export, distributed, random) can be set at a time properties: diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 0a4575bbf..050977f42 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -2923,12 +2923,14 @@ type CephFilesystemSubVolumeGroupList struct { // CephFilesystemSubVolumeGroupSpec represents the specification of a Ceph Filesystem SubVolumeGroup type CephFilesystemSubVolumeGroupSpec struct { // The name of the subvolume group. If not set, the default is the name of the subvolumeGroup CR. + // +kubebuilder:validation:XValidation:message="name is immutable",rule="self == oldSelf" // +optional Name string `json:"name,omitempty"` // FilesystemName is the name of Ceph Filesystem SubVolumeGroup volume name. Typically it's the name of // the CephFilesystem CR. If not coming from the CephFilesystem CR, it can be retrieved from the // list of Ceph Filesystem volumes with `ceph fs volume ls`. To learn more about Ceph Filesystem // abstractions see https://docs.ceph.com/en/latest/cephfs/fs-volumes/#fs-volumes-and-subvolumes + // +kubebuilder:validation:XValidation:message="filesystemName is immutable",rule="self == oldSelf" FilesystemName string `json:"filesystemName"` // Pinning configuration of CephFilesystemSubVolumeGroup, // reference https://docs.ceph.com/en/latest/cephfs/fs-volumes/#pinning-subvolumes-and-subvolume-groups @@ -2998,10 +3000,12 @@ type CephBlockPoolRadosNamespaceList struct { // CephBlockPoolRadosNamespaceSpec represents the specification of a CephBlockPool Rados Namespace type CephBlockPoolRadosNamespaceSpec struct { // The name of the CephBlockPoolRadosNamespaceSpec namespace. If not set, the default is the name of the CR. + // +kubebuilder:validation:XValidation:message="name is immutable",rule="self == oldSelf" // +optional Name string `json:"name,omitempty"` // BlockPoolName is the name of Ceph BlockPool. Typically it's the name of // the CephBlockPool CR. + // +kubebuilder:validation:XValidation:message="blockPoolName is immutable",rule="self == oldSelf" BlockPoolName string `json:"blockPoolName"` } diff --git a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go index 57bd0bceb..4d30bb219 100644 --- a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go @@ -1904,6 +1904,23 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { in.Security.DeepCopyInto(&out.Security) in.LogCollector.DeepCopyInto(&out.LogCollector) in.CSI.DeepCopyInto(&out.CSI) + if in.CephConfig != nil { + in, out := &in.CephConfig, &out.CephConfig + *out = make(map[string]map[string]string, len(*in)) + for key, val := range *in { + var outVal map[string]string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + (*out)[key] = outVal + } + } return }