Skip to content

Commit 7d64141

Browse files
committed
fix kubebuilder annotation for enums
Signed-off-by: apedriza <adripedriza@gmail.com>
1 parent 7ccc4d2 commit 7d64141

10 files changed

Lines changed: 89 additions & 41 deletions

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ linters:
5757
rules:
5858
- linters: [revive]
5959
text: "var-naming: avoid meaningless package names"
60-
path: "internal/controller/util/"
60+
path: "(internal/controller/util/|inttest/util/)"
6161
paths:
6262
# Ignore issues in generated files.
6363
- zz_generated.*\.go$

api/k0smotron.io/v1beta1/k0smotroncluster_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type ClusterSpec struct {
6767
// Persistence defines the persistence configuration. If empty k0smotron
6868
// will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
6969
//+kubebuilder:validation:Optional
70+
//+kubebuilder:default={"type":"emptyDir"}
7071
Persistence PersistenceSpec `json:"persistence,omitempty"`
7172
// KineDataSourceURL defines the kine datasource URL.
7273
//+kubebuilder:validation:Optional
@@ -292,7 +293,9 @@ type ClusterList struct {
292293

293294
// PersistenceSpec defines the persistence configuration for the k0s control plane.
294295
type PersistenceSpec struct {
295-
//+kubebuilder:validation:Enum:emptyDir;hostPath;pvc
296+
// Type defines the type of persistence to be used for the k0s control plane.
297+
//+kubebuilder:validation:Enum=emptyDir;hostPath;pvc
298+
//+kubebuilder:validation:Optional
296299
//+kubebuilder:default=emptyDir
297300
Type string `json:"type"`
298301
// PersistentVolumeClaim defines the PVC configuration. Will be used as is in case of .spec.persistence.type is pvc.

config/clusterapi/controlplane/crd/bases/controlplane.cluster.x-k8s.io_k0smotroncontrolplanes.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,6 +4179,8 @@ spec:
41794179
type: object
41804180
type: array
41814181
persistence:
4182+
default:
4183+
type: emptyDir
41824184
description: |-
41834185
Persistence defines the persistence configuration. If empty k0smotron
41844186
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4618,9 +4620,13 @@ spec:
46184620
type: object
46194621
type:
46204622
default: emptyDir
4623+
description: Type defines the type of persistence to be used for
4624+
the k0s control plane.
4625+
enum:
4626+
- emptyDir
4627+
- hostPath
4628+
- pvc
46214629
type: string
4622-
required:
4623-
- type
46244630
type: object
46254631
replicas:
46264632
default: 1

config/clusterapi/controlplane/crd/bases/controlplane.cluster.x-k8s.io_k0smotroncontrolplanetemplates.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,6 +4206,8 @@ spec:
42064206
type: object
42074207
type: array
42084208
persistence:
4209+
default:
4210+
type: emptyDir
42094211
description: |-
42104212
Persistence defines the persistence configuration. If empty k0smotron
42114213
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4667,9 +4669,13 @@ spec:
46674669
type: object
46684670
type:
46694671
default: emptyDir
4672+
description: Type defines the type of persistence to be
4673+
used for the k0s control plane.
4674+
enum:
4675+
- emptyDir
4676+
- hostPath
4677+
- pvc
46704678
type: string
4671-
required:
4672-
- type
46734679
type: object
46744680
replicas:
46754681
default: 1

config/crd/controlplane.cluster.x-k8s.io_k0smotroncontrolplanes.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,6 +4179,8 @@ spec:
41794179
type: object
41804180
type: array
41814181
persistence:
4182+
default:
4183+
type: emptyDir
41824184
description: |-
41834185
Persistence defines the persistence configuration. If empty k0smotron
41844186
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4618,9 +4620,13 @@ spec:
46184620
type: object
46194621
type:
46204622
default: emptyDir
4623+
description: Type defines the type of persistence to be used for
4624+
the k0s control plane.
4625+
enum:
4626+
- emptyDir
4627+
- hostPath
4628+
- pvc
46214629
type: string
4622-
required:
4623-
- type
46244630
type: object
46254631
replicas:
46264632
default: 1

config/crd/controlplane.cluster.x-k8s.io_k0smotroncontrolplanetemplates.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,6 +4206,8 @@ spec:
42064206
type: object
42074207
type: array
42084208
persistence:
4209+
default:
4210+
type: emptyDir
42094211
description: |-
42104212
Persistence defines the persistence configuration. If empty k0smotron
42114213
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4667,9 +4669,13 @@ spec:
46674669
type: object
46684670
type:
46694671
default: emptyDir
4672+
description: Type defines the type of persistence to be
4673+
used for the k0s control plane.
4674+
enum:
4675+
- emptyDir
4676+
- hostPath
4677+
- pvc
46704678
type: string
4671-
required:
4672-
- type
46734679
type: object
46744680
replicas:
46754681
default: 1

config/crd/k0smotron.io_clusters.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4139,6 +4139,8 @@ spec:
41394139
type: object
41404140
type: array
41414141
persistence:
4142+
default:
4143+
type: emptyDir
41424144
description: |-
41434145
Persistence defines the persistence configuration. If empty k0smotron
41444146
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4578,9 +4580,13 @@ spec:
45784580
type: object
45794581
type:
45804582
default: emptyDir
4583+
description: Type defines the type of persistence to be used for
4584+
the k0s control plane.
4585+
enum:
4586+
- emptyDir
4587+
- hostPath
4588+
- pvc
45814589
type: string
4582-
required:
4583-
- type
45844590
type: object
45854591
replicas:
45864592
default: 1

config/standalone/crd/bases/k0smotron.io_clusters.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4139,6 +4139,8 @@ spec:
41394139
type: object
41404140
type: array
41414141
persistence:
4142+
default:
4143+
type: emptyDir
41424144
description: |-
41434145
Persistence defines the persistence configuration. If empty k0smotron
41444146
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence
@@ -4578,9 +4580,13 @@ spec:
45784580
type: object
45794581
type:
45804582
default: emptyDir
4583+
description: Type defines the type of persistence to be used for
4584+
the k0s control plane.
4585+
enum:
4586+
- emptyDir
4587+
- hostPath
4588+
- pvc
45814589
type: string
4582-
required:
4583-
- type
45844590
type: object
45854591
replicas:
45864592
default: 1

docs/resource-reference/controlplane.cluster.x-k8s.io-v1beta1.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,8 @@ https://kubernetes.io/docs/concepts/storage/volumes<br/>
20812081
<td>
20822082
Persistence defines the persistence configuration. If empty k0smotron
20832083
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence<br/>
2084+
<br/>
2085+
<i>Default</i>: map[type:emptyDir]<br/>
20842086
</td>
20852087
<td>false</td>
20862088
</tr><tr>
@@ -10504,15 +10506,6 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
1050410506
</tr>
1050510507
</thead>
1050610508
<tbody><tr>
10507-
<td><b>type</b></td>
10508-
<td>string</td>
10509-
<td>
10510-
<br/>
10511-
<br/>
10512-
<i>Default</i>: emptyDir<br/>
10513-
</td>
10514-
<td>true</td>
10515-
</tr><tr>
1051610509
<td><b>autoDeletePVCs</b></td>
1051710510
<td>boolean</td>
1051810511
<td>
@@ -10535,6 +10528,16 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
1053510528
PersistentVolumeClaim defines the PVC configuration. Will be used as is in case of .spec.persistence.type is pvc.<br/>
1053610529
</td>
1053710530
<td>false</td>
10531+
</tr><tr>
10532+
<td><b>type</b></td>
10533+
<td>enum</td>
10534+
<td>
10535+
Type defines the type of persistence to be used for the k0s control plane.<br/>
10536+
<br/>
10537+
<i>Enum</i>: emptyDir, hostPath, pvc<br/>
10538+
<i>Default</i>: emptyDir<br/>
10539+
</td>
10540+
<td>false</td>
1053810541
</tr></tbody>
1053910542
</table>
1054010543

@@ -12228,6 +12231,8 @@ https://kubernetes.io/docs/concepts/storage/volumes<br/>
1222812231
<td>
1222912232
Persistence defines the persistence configuration. If empty k0smotron
1223012233
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence<br/>
12234+
<br/>
12235+
<i>Default</i>: map[type:emptyDir]<br/>
1223112236
</td>
1223212237
<td>false</td>
1223312238
</tr><tr>
@@ -20651,15 +20656,6 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
2065120656
</tr>
2065220657
</thead>
2065320658
<tbody><tr>
20654-
<td><b>type</b></td>
20655-
<td>string</td>
20656-
<td>
20657-
<br/>
20658-
<br/>
20659-
<i>Default</i>: emptyDir<br/>
20660-
</td>
20661-
<td>true</td>
20662-
</tr><tr>
2066320659
<td><b>autoDeletePVCs</b></td>
2066420660
<td>boolean</td>
2066520661
<td>
@@ -20682,6 +20678,16 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
2068220678
PersistentVolumeClaim defines the PVC configuration. Will be used as is in case of .spec.persistence.type is pvc.<br/>
2068320679
</td>
2068420680
<td>false</td>
20681+
</tr><tr>
20682+
<td><b>type</b></td>
20683+
<td>enum</td>
20684+
<td>
20685+
Type defines the type of persistence to be used for the k0s control plane.<br/>
20686+
<br/>
20687+
<i>Enum</i>: emptyDir, hostPath, pvc<br/>
20688+
<i>Default</i>: emptyDir<br/>
20689+
</td>
20690+
<td>false</td>
2068520691
</tr></tbody>
2068620692
</table>
2068720693

docs/resource-reference/k0smotron.io-v1beta1.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ https://kubernetes.io/docs/concepts/storage/volumes<br/>
215215
<td>
216216
Persistence defines the persistence configuration. If empty k0smotron
217217
will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuration/#persistence<br/>
218+
<br/>
219+
<i>Default</i>: map[type:emptyDir]<br/>
218220
</td>
219221
<td>false</td>
220222
</tr><tr>
@@ -8638,15 +8640,6 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
86388640
</tr>
86398641
</thead>
86408642
<tbody><tr>
8641-
<td><b>type</b></td>
8642-
<td>string</td>
8643-
<td>
8644-
<br/>
8645-
<br/>
8646-
<i>Default</i>: emptyDir<br/>
8647-
</td>
8648-
<td>true</td>
8649-
</tr><tr>
86508643
<td><b>autoDeletePVCs</b></td>
86518644
<td>boolean</td>
86528645
<td>
@@ -8669,6 +8662,16 @@ will use emptyDir as a volume. See https://docs.k0smotron.io/stable/configuratio
86698662
PersistentVolumeClaim defines the PVC configuration. Will be used as is in case of .spec.persistence.type is pvc.<br/>
86708663
</td>
86718664
<td>false</td>
8665+
</tr><tr>
8666+
<td><b>type</b></td>
8667+
<td>enum</td>
8668+
<td>
8669+
Type defines the type of persistence to be used for the k0s control plane.<br/>
8670+
<br/>
8671+
<i>Enum</i>: emptyDir, hostPath, pvc<br/>
8672+
<i>Default</i>: emptyDir<br/>
8673+
</td>
8674+
<td>false</td>
86728675
</tr></tbody>
86738676
</table>
86748677

0 commit comments

Comments
 (0)