Skip to content

Commit 839de1d

Browse files
authored
Merge pull request #218 from black-dragon74/conversion-webhook
Update api versions to v1
2 parents 66f327c + 77d3de1 commit 839de1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+60468
-160
lines changed

PROJECT

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,44 @@ resources:
5151
kind: ClientProfileMapping
5252
path: github.com/ceph/ceph-csi-operator/api/v1alpha1
5353
version: v1alpha1
54+
- api:
55+
crdVersion: v1
56+
namespaced: true
57+
domain: ceph.io
58+
group: csi
59+
kind: CephConnection
60+
path: github.com/ceph/ceph-csi-operator/api/v1
61+
version: v1
62+
- api:
63+
crdVersion: v1
64+
namespaced: true
65+
domain: ceph.io
66+
group: csi
67+
kind: ClientProfile
68+
path: github.com/ceph/ceph-csi-operator/api/v1
69+
version: v1
70+
- api:
71+
crdVersion: v1
72+
namespaced: true
73+
domain: ceph.io
74+
group: csi
75+
kind: ClientProfileMapping
76+
path: github.com/ceph/ceph-csi-operator/api/v1
77+
version: v1
78+
- api:
79+
crdVersion: v1
80+
namespaced: true
81+
domain: ceph.io
82+
group: csi
83+
kind: OperatorConfig
84+
path: github.com/ceph/ceph-csi-operator/api/v1
85+
version: v1
86+
- api:
87+
crdVersion: v1
88+
namespaced: true
89+
domain: ceph.io
90+
group: csi
91+
kind: Driver
92+
path: github.com/ceph/ceph-csi-operator/api/v1
93+
version: v1
5494
version: "3"

api/v1/cephconnection_types.go

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// ReadAffinitySpec capture Ceph CSI read affinity settings
24+
type ReadAffinitySpec struct {
25+
//+kubebuilder:validation:Required
26+
//+kubebuilder:validation:MinItems:=1
27+
CrushLocationLabels []string `json:"crushLocationLabels,omitempty"`
28+
}
29+
30+
// CephConnectionSpec defines the desired state of CephConnection
31+
type CephConnectionSpec struct {
32+
//+kubebuilder:validation:Required
33+
//+kubebuilder:validation:MinItems:=1
34+
Monitors []string `json:"monitors"`
35+
36+
//+kubebuilder:validation:Optional
37+
ReadAffinity *ReadAffinitySpec `json:"readAffinity,omitempty"`
38+
39+
//+kubebuilder:validation:Optional
40+
//+kubebuilder:validation:Minimum:=1
41+
RbdMirrorDaemonCount int `json:"rbdMirrorDaemonCount,omitempty"`
42+
}
43+
44+
// CephConnectionStatus defines the observed state of CephConnection
45+
type CephConnectionStatus struct {
46+
}
47+
48+
//+kubebuilder:object:root=true
49+
//+kubebuilder:storageversion
50+
//+kubebuilder:subresource:status
51+
52+
// CephConnection is the Schema for the cephconnections API
53+
type CephConnection struct {
54+
metav1.TypeMeta `json:",inline"`
55+
metav1.ObjectMeta `json:"metadata,omitempty"`
56+
57+
Spec CephConnectionSpec `json:"spec,omitempty"`
58+
Status CephConnectionStatus `json:"status,omitempty"`
59+
}
60+
61+
//+kubebuilder:object:root=true
62+
63+
// CephConnectionList contains a list of CephConnections
64+
type CephConnectionList struct {
65+
metav1.TypeMeta `json:",inline"`
66+
metav1.ListMeta `json:"metadata,omitempty"`
67+
Items []CephConnection `json:"items"`
68+
}

api/v1/clientprofile_types.go

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
corev1 "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
)
23+
24+
// CephFsConfigSpec defines the desired CephFs configuration
25+
type CephFsConfigSpec struct {
26+
//+kubebuilder:validation:Optional
27+
SubVolumeGroup string `json:"subVolumeGroup,omitempty"`
28+
29+
//+kubebuilder:validation:Optional
30+
KernelMountOptions map[string]string `json:"kernelMountOptions,omitempty"`
31+
32+
//+kubebuilder:validation:Optional
33+
FuseMountOptions map[string]string `json:"fuseMountOptions,omitempty"`
34+
35+
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
36+
//+kubebuilder:validation:Optional
37+
RadosNamespace *string `json:"radosNamespace,omitempty"`
38+
}
39+
40+
// RbdConfigSpec defines the desired RBD configuration
41+
type RbdConfigSpec struct {
42+
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
43+
//+kubebuilder:validation:Optional
44+
RadosNamespace string `json:"radosNamespace,omitempty"`
45+
}
46+
47+
// NfsConfigSpec cdefines the desired NFS configuration
48+
type NfsConfigSpec struct {
49+
}
50+
51+
// ClientProfileSpec defines the desired state of Ceph CSI
52+
// configuration for volumes and snapshots configured to use
53+
// this profile
54+
type ClientProfileSpec struct {
55+
//+kubebuilder:validation:Required
56+
//+kubebuilder:validation:XValidation:rule=self.name != "",message="'.name' cannot be empty"
57+
CephConnectionRef corev1.LocalObjectReference `json:"cephConnectionRef"`
58+
59+
//+kubebuilder:validation:Optional
60+
CephFs *CephFsConfigSpec `json:"cephFs,omitempty"`
61+
62+
//+kubebuilder:validation:Optional
63+
Rbd *RbdConfigSpec `json:"rbd,omitempty"`
64+
65+
//+kubebuilder:validation:Optional
66+
Nfs *NfsConfigSpec `json:"nfs,omitempty"`
67+
}
68+
69+
// ClientProfileStatus defines the observed state of Ceph CSI
70+
// configuration for volumes and snapshots configured to use
71+
// this profile
72+
type ClientProfileStatus struct {
73+
}
74+
75+
//+kubebuilder:object:root=true
76+
//+kubebuilder:storageversion
77+
//+kubebuilder:subresource:status
78+
79+
// ClientProfile is the Schema for the clientprofiles API
80+
type ClientProfile struct {
81+
metav1.TypeMeta `json:",inline"`
82+
metav1.ObjectMeta `json:"metadata,omitempty"`
83+
84+
Spec ClientProfileSpec `json:"spec,omitempty"`
85+
Status ClientProfileStatus `json:"status,omitempty"`
86+
}
87+
88+
//+kubebuilder:object:root=true
89+
90+
// ClientProfileList contains a list of ClientProfile
91+
type ClientProfileList struct {
92+
metav1.TypeMeta `json:",inline"`
93+
metav1.ListMeta `json:"metadata,omitempty"`
94+
Items []ClientProfile `json:"items"`
95+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// +kubebuilder:validation:MinItems:=2
24+
// +kubebuilder:validation:MaxItems:=2
25+
type BlockPoolIdPair []string
26+
27+
// MappingsSpec define a mapping between a local and remote profiles
28+
type MappingsSpec struct {
29+
//+kubebuilder:validation:Required
30+
LocalClientProfile string `json:"localClientProfile,omitempty"`
31+
32+
//+kubebuilder:validation:Required
33+
RemoteClientProfile string `json:"remoteClientProfile,omitempty"`
34+
35+
//+kubebuilder:validation:Optional
36+
BlockPoolIdMapping []BlockPoolIdPair `json:"blockPoolIdMapping,omitempty"`
37+
}
38+
39+
// ClientProfileMappingSpec defines the desired state of ClientProfileMapping
40+
type ClientProfileMappingSpec struct {
41+
//+kubebuilder:validation:Required
42+
Mappings []MappingsSpec `json:"mappings,omitempty"`
43+
}
44+
45+
// ClientProfileMappingStatus defines the observed state of ClientProfileMapping
46+
type ClientProfileMappingStatus struct {
47+
}
48+
49+
//+kubebuilder:object:root=true
50+
//+kubebuilder:storageversion
51+
//+kubebuilder:subresource:status
52+
53+
// ClientProfileMapping is the Schema for the clientprofilemappings API
54+
type ClientProfileMapping struct {
55+
metav1.TypeMeta `json:",inline"`
56+
metav1.ObjectMeta `json:"metadata,omitempty"`
57+
58+
Spec ClientProfileMappingSpec `json:"spec,omitempty"`
59+
Status ClientProfileMappingStatus `json:"status,omitempty"`
60+
}
61+
62+
//+kubebuilder:object:root=true
63+
64+
// ClientProfileMappingList contains a list of ClientProfileMapping
65+
type ClientProfileMappingList struct {
66+
metav1.TypeMeta `json:",inline"`
67+
metav1.ListMeta `json:"metadata,omitempty"`
68+
Items []ClientProfileMapping `json:"items"`
69+
}

0 commit comments

Comments
 (0)