Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/v1alpha1/clientprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ type CephFsConfigSpec struct {

//+kubebuilder:validation:Optional
FuseMountOptions map[string]string `json:"fuseMountOptions,omitempty"`

//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
//+kubebuilder:validation:Optional
RadosNamespace *string `json:"radosNamespace,omitempty"`
}

// RbdConfigSpec defines the desired RBD configuration
type RbdConfigSpec struct {
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
//+kubebuilder:validation:Optional
RadosNamespace string `json:"radosNamespace,omitempty"`
}
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions config/crd/bases/csi.ceph.io_clientprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
additionalProperties:
type: string
type: object
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
subVolumeGroup:
type: string
type: object
Expand All @@ -85,6 +90,9 @@ spec:
properties:
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
type: object
required:
- cephConnectionRef
Expand Down
8 changes: 8 additions & 0 deletions deploy/all-in-one/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ spec:
additionalProperties:
type: string
type: object
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
subVolumeGroup:
type: string
type: object
Expand All @@ -233,6 +238,9 @@ spec:
properties:
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
type: object
required:
- cephConnectionRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
additionalProperties:
type: string
type: object
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
subVolumeGroup:
type: string
type: object
Expand All @@ -86,6 +91,9 @@ spec:
properties:
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
type: object
required:
- cephConnectionRef
Expand Down
8 changes: 8 additions & 0 deletions deploy/multifile/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ spec:
additionalProperties:
type: string
type: object
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
subVolumeGroup:
type: string
type: object
Expand All @@ -224,6 +229,9 @@ spec:
properties:
radosNamespace:
type: string
x-kubernetes-validations:
- message: field is immutable
rule: self == oldSelf
type: object
required:
- cephConnectionRef
Expand Down
1 change: 1 addition & 0 deletions docs/design/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ spec:
subvolumeGroup: csi
kernelMountOptions: readdir_max_bytes=1048576,norbytes
fuseMountOptions: debug
radosNamespace: rados-test-cephfs
rbd:
radosNamespace: rados-test
status: {}
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/clientprofile_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -69,6 +70,7 @@ type csiClusterInfoRecord struct {
SubvolumeGroup string `json:"subvolumeGroup,omitempty"`
KernelMountOptions string `json:"kernelMountOptions"`
FuseMountOptions string `json:"fuseMountOptions"`
RadosNamespace string `json:"radosNamespace,omitempty"`
} `json:"cephFS,omitempty"`
Rbd struct {
RadosNamespace string `json:"radosNamespace,omitempty"`
Expand Down Expand Up @@ -313,6 +315,7 @@ func composeCsiClusterInfoRecord(clientProfile *csiv1a1.ClientProfile, cephConn
record.Monitors = cephConn.Spec.Monitors
if cephFs := clientProfile.Spec.CephFs; cephFs != nil {
record.CephFs.SubvolumeGroup = cephFs.SubVolumeGroup
record.CephFs.RadosNamespace = ptr.Deref(cephFs.RadosNamespace, "")
if mountOpt := cephFs.KernelMountOptions; mountOpt != nil {
record.CephFs.KernelMountOptions = utils.MapToString(mountOpt, "=", ",")
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading