Skip to content

Commit af2c88b

Browse files
authored
Make slight changes to the CRDs (#736)
Module: make moduleName an optional field. ManagedClusterModule: make spokeNamespace a required field.
1 parent 8841e20 commit af2c88b

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

api-hub/v1beta1/managedclustermodule_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ManagedClusterModuleSpec struct {
2727
ModuleSpec kmmv1beta1.ModuleSpec `json:"moduleSpec,omitempty"`
2828

2929
// SpokeNamespace describes the Spoke namespace, in which the ModuleSpec should be applied.
30-
SpokeNamespace string `json:"spokeNamespace,omitempty"`
30+
SpokeNamespace string `json:"spokeNamespace"`
3131

3232
// Selector describes on which managed clusters the ModuleSpec should be applied.
3333
Selector map[string]string `json:"selector"`

api/v1beta1/module_types.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ type ModprobeArgs struct {
136136

137137
type ModprobeSpec struct {
138138
// ModuleName is the name of the Module to be loaded.
139-
ModuleName string `json:"moduleName"`
139+
// This field can only be unset if rawArgs is set.
140+
// +optional
141+
ModuleName string `json:"moduleName,omitempty"`
140142

141143
// Parameters is an optional list of kernel module parameters to be provided to modprobe.
142144
// They should be in the form of key=value and will be separated by spaces in the modprobe command.

config/crd-hub/bases/hub.kmm.sigs.x-k8s.io_managedclustermodules.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2371,8 +2371,9 @@ spec:
23712371
The firmware(s) will be copied to the host for the kernel to find them.
23722372
type: string
23732373
moduleName:
2374-
description: ModuleName is the name of the Module
2375-
to be loaded.
2374+
description: |-
2375+
ModuleName is the name of the Module to be loaded.
2376+
This field can only be unset if rawArgs is set.
23762377
type: string
23772378
modulesLoadingOrder:
23782379
description: |-
@@ -2418,8 +2419,6 @@ spec:
24182419
minItems: 1
24192420
type: array
24202421
type: object
2421-
required:
2422-
- moduleName
24232422
type: object
24242423
registryTLS:
24252424
description: RegistryTLS set the TLS configs for accessing
@@ -2531,6 +2530,7 @@ spec:
25312530
type: string
25322531
required:
25332532
- selector
2533+
- spokeNamespace
25342534
type: object
25352535
status:
25362536
description: ManagedClusterModuleStatus defines the observed state of

config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -2348,8 +2348,9 @@ spec:
23482348
The firmware(s) will be copied to the host for the kernel to find them.
23492349
type: string
23502350
moduleName:
2351-
description: ModuleName is the name of the Module to be
2352-
loaded.
2351+
description: |-
2352+
ModuleName is the name of the Module to be loaded.
2353+
This field can only be unset if rawArgs is set.
23532354
type: string
23542355
modulesLoadingOrder:
23552356
description: |-
@@ -2395,8 +2396,6 @@ spec:
23952396
minItems: 1
23962397
type: array
23972398
type: object
2398-
required:
2399-
- moduleName
24002399
type: object
24012400
registryTLS:
24022401
description: RegistryTLS set the TLS configs for accessing

config/crd/bases/kmm.sigs.x-k8s.io_nodemodulesconfigs.yaml

+6-8
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ spec:
9696
The firmware(s) will be copied to the host for the kernel to find them.
9797
type: string
9898
moduleName:
99-
description: ModuleName is the name of the Module to
100-
be loaded.
99+
description: |-
100+
ModuleName is the name of the Module to be loaded.
101+
This field can only be unset if rawArgs is set.
101102
type: string
102103
modulesLoadingOrder:
103104
description: |-
@@ -143,8 +144,6 @@ spec:
143144
minItems: 1
144145
type: array
145146
type: object
146-
required:
147-
- moduleName
148147
type: object
149148
required:
150149
- containerImage
@@ -236,8 +235,9 @@ spec:
236235
The firmware(s) will be copied to the host for the kernel to find them.
237236
type: string
238237
moduleName:
239-
description: ModuleName is the name of the Module to
240-
be loaded.
238+
description: |-
239+
ModuleName is the name of the Module to be loaded.
240+
This field can only be unset if rawArgs is set.
241241
type: string
242242
modulesLoadingOrder:
243243
description: |-
@@ -283,8 +283,6 @@ spec:
283283
minItems: 1
284284
type: array
285285
type: object
286-
required:
287-
- moduleName
288286
type: object
289287
required:
290288
- containerImage

0 commit comments

Comments
 (0)