Skip to content

Commit d41549b

Browse files
committed
feat: add COSI controller API
1 parent d5d6cfd commit d41549b

File tree

5 files changed

+114
-5
lines changed

5 files changed

+114
-5
lines changed

api/v1alpha1/addon_types.go

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,19 @@ type DockerAddons struct {
7070

7171
// +kubebuilder:validation:Optional
7272
CSI *DockerCSI `json:"csi,omitempty"`
73+
74+
// +kubebuilder:validation:Optional
75+
COSI *DockerCOSI `json:"cosi,omitempty"`
7376
}
7477

7578
type NutanixAddons struct {
7679
GenericAddons `json:",inline"`
7780

7881
// +kubebuilder:validation:Optional
7982
CSI *NutanixCSI `json:"csi,omitempty"`
83+
84+
// +kubebuilder:validation:Optional
85+
COSI *NutanixCOSI `json:"cosi,omitempty"`
8086
}
8187

8288
type GenericAddons struct {
@@ -96,8 +102,6 @@ type GenericAddons struct {
96102
ServiceLoadBalancer *ServiceLoadBalancer `json:"serviceLoadBalancer,omitempty"`
97103
}
98104

99-
// +kubebuilder:validation:Optional
100-
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
101105
type AddonStrategy string
102106

103107
// CNI required for providing CNI configuration.
@@ -109,13 +113,15 @@ type CNI struct {
109113

110114
// Addon strategy used to deploy the CNI provider to the workload cluster.
111115
// +kubebuilder:default=HelmAddon
116+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
112117
Strategy *AddonStrategy `json:"strategy,omitempty"`
113118
}
114119

115120
// NFD tells us to enable or disable the node feature discovery addon.
116121
type NFD struct {
117122
// Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster.
118123
// +kubebuilder:default=HelmAddon
124+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
119125
Strategy *AddonStrategy `json:"strategy,omitempty"`
120126
}
121127

@@ -124,6 +130,7 @@ type ClusterAutoscaler struct {
124130
// Addon strategy used to deploy cluster-autoscaler to the management cluster
125131
// targeting the workload cluster.
126132
// +kubebuilder:default=HelmAddon
133+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
127134
Strategy *AddonStrategy `json:"strategy,omitempty"`
128135
}
129136

@@ -136,9 +143,17 @@ type GenericCSI struct {
136143
SnapshotController *SnapshotController `json:"snapshotController,omitempty"`
137144
}
138145

146+
type GenericCOSI struct {
147+
// Addon strategy used to deploy the COSI controller to the workload cluster.
148+
// +kubebuilder:default=HelmAddon
149+
// +kubebuilder:validation:Enum=HelmAddon
150+
Strategy *AddonStrategy `json:"strategy,omitempty"`
151+
}
152+
139153
type SnapshotController struct {
140154
// Addon strategy used to deploy the snapshot controller to the workload cluster.
141155
// +kubebuilder:default=HelmAddon
156+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
142157
Strategy *AddonStrategy `json:"strategy,omitempty"`
143158
}
144159

@@ -197,6 +212,7 @@ type CSIProvider struct {
197212

198213
// Addon strategy used to deploy the CSI provider to the workload cluster.
199214
// +kubebuilder:default=HelmAddon
215+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
200216
Strategy *AddonStrategy `json:"strategy,omitempty"`
201217

202218
// The reference to any secret used by the CSI Provider.
@@ -231,6 +247,14 @@ type CSICredentials struct {
231247
SecretRef LocalObjectReference `json:"secretRef"`
232248
}
233249

250+
type DockerCOSI struct {
251+
GenericCOSI `json:",inline"`
252+
}
253+
254+
type NutanixCOSI struct {
255+
GenericCOSI `json:",inline"`
256+
}
257+
234258
// CCM tells us to enable or disable the cloud provider interface.
235259
type CCM struct {
236260
// A reference to the Secret for credential information for the target Prism Central instance
@@ -239,6 +263,7 @@ type CCM struct {
239263

240264
// Addon strategy used to deploy the CCM to the workload cluster.
241265
// +kubebuilder:default=HelmAddon
266+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
242267
Strategy *AddonStrategy `json:"strategy,omitempty"`
243268
}
244269

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ spec:
104104
required:
105105
- provider
106106
type: object
107+
cosi:
108+
properties:
109+
strategy:
110+
default: HelmAddon
111+
description: Addon strategy used to deploy the COSI controller to the workload cluster.
112+
enum:
113+
- HelmAddon
114+
type: string
115+
type: object
107116
csi:
108117
properties:
109118
defaultStorage:

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ spec:
104104
required:
105105
- provider
106106
type: object
107+
cosi:
108+
properties:
109+
strategy:
110+
default: HelmAddon
111+
description: Addon strategy used to deploy the COSI controller to the workload cluster.
112+
enum:
113+
- HelmAddon
114+
type: string
115+
type: object
107116
csi:
108117
properties:
109118
defaultStorage:

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 63 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/variables/aggregate_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,16 @@ type Addons struct {
5353
carenv1.GenericAddons `json:",inline"`
5454

5555
CSI *CSI `json:"csi,omitempty"`
56+
57+
COSI *COSI `json:"cosi,omitempty"`
5658
}
5759

5860
type CSI struct {
5961
carenv1.GenericCSI `json:",inline"`
6062

6163
Providers map[string]carenv1.CSIProvider `json:"providers"`
6264
}
65+
66+
type COSI struct {
67+
carenv1.GenericCOSI `json:",inline"`
68+
}

0 commit comments

Comments
 (0)