Skip to content

Commit 51d554e

Browse files
ybettank8s-ci-robot
authored andcommitted
Adding all KMM CRDs generated files to KMM-hub.
KMM-hub only generates CRD files based on the `api-hub/` directory which doesn't contain some CRDs required for KMM-hub such as `MIC` and `MBSC`, therefore, KMM-hub isn't working because it tries to start controllers reconciling CRDs that don't exist in the cluster. It worked in CI until now because we are using the same single-node cluster as the hub cluster and the spoke cluster so KMM-hub was basically using the CRDs applied by the KMM bundle and not the KMM-hub bundle. This commit is generating all CRD files into the `config/crd-hub/bases` directory but only applies to the cluster the resources it actually needs. Signed-off-by: Yoni Bettan <[email protected]>
1 parent 37cd7cc commit 51d554e

7 files changed

+4267
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
103103
$(CONTROLLER_GEN) webhook paths="./internal/webhook" output:webhook:artifacts:config=config/webhook
104104
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers" output:rbac:artifacts:config=config/rbac
105105
# Hub
106+
$(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=config/crd-hub/bases
106107
$(CONTROLLER_GEN) crd paths="./api-hub/..." output:crd:artifacts:config=config/crd-hub/bases
107108
$(CONTROLLER_GEN) webhook paths="./internal/webhook/hub" output:webhook:artifacts:config=config/webhook-hub
108109
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers/hub" output:rbac:artifacts:config=config/rbac-hub
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.1
7+
name: modulebuildsignconfigs.kmm.sigs.x-k8s.io
8+
spec:
9+
group: kmm.sigs.x-k8s.io
10+
names:
11+
kind: ModuleBuildSignConfig
12+
listKind: ModuleBuildSignConfigList
13+
plural: modulebuildsignconfigs
14+
shortNames:
15+
- mbsc
16+
singular: modulebuildsignconfig
17+
scope: Namespaced
18+
versions:
19+
- name: v1beta1
20+
schema:
21+
openAPIV3Schema:
22+
description: ModuleBuildSignConfig keeps the request for images' build/sign
23+
for a KMM Module.
24+
properties:
25+
apiVersion:
26+
description: |-
27+
APIVersion defines the versioned schema of this representation of an object.
28+
Servers should convert recognized schemas to the latest internal value, and
29+
may reject unrecognized values.
30+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
31+
type: string
32+
kind:
33+
description: |-
34+
Kind is a string value representing the REST resource this object represents.
35+
Servers may infer this from the endpoint the client submits requests to.
36+
Cannot be updated.
37+
In CamelCase.
38+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
39+
type: string
40+
metadata:
41+
type: object
42+
spec:
43+
description: |-
44+
ModuleBuildSignConfigSpec describes the images that need to be built/signed
45+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
46+
properties:
47+
imageRepoSecret:
48+
description: ImageRepoSecret contains pull secret for the image's
49+
repo, if needed
50+
properties:
51+
name:
52+
default: ""
53+
description: |-
54+
Name of the referent.
55+
This field is effectively required, but due to backwards compatibility is
56+
allowed to be empty. Instances of this type with an empty value here are
57+
almost certainly wrong.
58+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
59+
type: string
60+
type: object
61+
x-kubernetes-map-type: atomic
62+
images:
63+
items:
64+
description: ModuleBuildSignSpec describes the image whose state
65+
needs to be queried
66+
properties:
67+
action:
68+
enum:
69+
- BuildImage
70+
- SignImage
71+
type: string
72+
build:
73+
description: Build contains build instructions, in case image
74+
needs building
75+
properties:
76+
baseImageRegistryTLS:
77+
description: BaseImageRegistryTLS contains settings determining
78+
how to access registries of the base images in the build-process'
79+
Dockerfile.
80+
properties:
81+
insecure:
82+
description: If Insecure is true, the operator will
83+
be able to access a registry in an insecure (plain
84+
HTTP) protocol.
85+
type: boolean
86+
insecureSkipTLSVerify:
87+
description: If InsecureSkipTLSVerify, the operator
88+
will accept any certificate provided by the registry.
89+
type: boolean
90+
type: object
91+
buildArgs:
92+
description: BuildArgs is an array of build variables that
93+
are provided to the image building backend.
94+
items:
95+
description: BuildArg represents a build argument used
96+
when building a container image.
97+
properties:
98+
name:
99+
type: string
100+
value:
101+
type: string
102+
required:
103+
- name
104+
- value
105+
type: object
106+
type: array
107+
dockerfileConfigMap:
108+
description: ConfigMap that holds Dockerfile contents
109+
properties:
110+
name:
111+
default: ""
112+
description: |-
113+
Name of the referent.
114+
This field is effectively required, but due to backwards compatibility is
115+
allowed to be empty. Instances of this type with an empty value here are
116+
almost certainly wrong.
117+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
118+
type: string
119+
type: object
120+
x-kubernetes-map-type: atomic
121+
kanikoParams:
122+
description: KanikoParams is used to customize the building
123+
process of the image.
124+
properties:
125+
tag:
126+
description: Kaniko image tag to use when creating the
127+
build Pod
128+
type: string
129+
type: object
130+
secrets:
131+
description: |-
132+
Secrets is an optional list of secrets to be made available to the build system.
133+
Those secrets should be used for private resources such as a private Github repo.
134+
For container registries auth use module.spec.imagePullSecret instead.
135+
items:
136+
description: |-
137+
LocalObjectReference contains enough information to let you locate the
138+
referenced object inside the same namespace.
139+
properties:
140+
name:
141+
default: ""
142+
description: |-
143+
Name of the referent.
144+
This field is effectively required, but due to backwards compatibility is
145+
allowed to be empty. Instances of this type with an empty value here are
146+
almost certainly wrong.
147+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
148+
type: string
149+
type: object
150+
x-kubernetes-map-type: atomic
151+
type: array
152+
selector:
153+
additionalProperties:
154+
type: string
155+
description: Selector describes on which nodes will run
156+
the building process.
157+
type: object
158+
required:
159+
- dockerfileConfigMap
160+
type: object
161+
image:
162+
description: image
163+
type: string
164+
kernelVersion:
165+
description: kernel version for which this image is targeted
166+
type: string
167+
registryTLS:
168+
description: RegistryTLS set the TLS configs for accessing the
169+
registry of the image.
170+
properties:
171+
insecure:
172+
description: If Insecure is true, the operator will be able
173+
to access a registry in an insecure (plain HTTP) protocol.
174+
type: boolean
175+
insecureSkipTLSVerify:
176+
description: If InsecureSkipTLSVerify, the operator will
177+
accept any certificate provided by the registry.
178+
type: boolean
179+
type: object
180+
sign:
181+
description: Sign contains sign instructions, in case image
182+
needs signing
183+
properties:
184+
certSecret:
185+
description: a secret containing the public key used to
186+
sign kernel modules for secureboot
187+
properties:
188+
name:
189+
default: ""
190+
description: |-
191+
Name of the referent.
192+
This field is effectively required, but due to backwards compatibility is
193+
allowed to be empty. Instances of this type with an empty value here are
194+
almost certainly wrong.
195+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
196+
type: string
197+
type: object
198+
x-kubernetes-map-type: atomic
199+
filesToSign:
200+
description: paths inside the image for the kernel modules
201+
to sign (if ommited all kmods are signed)
202+
items:
203+
type: string
204+
type: array
205+
keySecret:
206+
description: a secret containing the private key used to
207+
sign kernel modules for secureboot
208+
properties:
209+
name:
210+
default: ""
211+
description: |-
212+
Name of the referent.
213+
This field is effectively required, but due to backwards compatibility is
214+
allowed to be empty. Instances of this type with an empty value here are
215+
almost certainly wrong.
216+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
217+
type: string
218+
type: object
219+
x-kubernetes-map-type: atomic
220+
unsignedImage:
221+
description: Image to sign, ignored if a Build is present,
222+
required otherwise
223+
type: string
224+
unsignedImageRegistryTLS:
225+
description: UnsignedImageRegistryTLS contains settings
226+
determining how to access registries of the unsigned image.
227+
properties:
228+
insecure:
229+
description: If Insecure is true, the operator will
230+
be able to access a registry in an insecure (plain
231+
HTTP) protocol.
232+
type: boolean
233+
insecureSkipTLSVerify:
234+
description: If InsecureSkipTLSVerify, the operator
235+
will accept any certificate provided by the registry.
236+
type: boolean
237+
type: object
238+
required:
239+
- certSecret
240+
- keySecret
241+
type: object
242+
skipWaitMissingImage:
243+
description: |-
244+
SkipWaitMissingImage signals to MIC to stop waiting for image to be present
245+
in case Build andSign not define, and report the image as DoesNotExist
246+
type: boolean
247+
required:
248+
- action
249+
- image
250+
- kernelVersion
251+
type: object
252+
type: array
253+
required:
254+
- images
255+
type: object
256+
status:
257+
description: |-
258+
ModuleBuildSignConfigStatus describes the status of the images that needed to be built/signed
259+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
260+
properties:
261+
images:
262+
items:
263+
description: BuildSignImageState contains the status of the image
264+
that was requested to be built/signed
265+
properties:
266+
action:
267+
enum:
268+
- BuildImage
269+
- SignImage
270+
type: string
271+
image:
272+
type: string
273+
status:
274+
enum:
275+
- Success
276+
- Failure
277+
type: string
278+
required:
279+
- action
280+
- image
281+
- status
282+
type: object
283+
type: array
284+
required:
285+
- images
286+
type: object
287+
type: object
288+
served: true
289+
storage: true
290+
subresources:
291+
status: {}

0 commit comments

Comments
 (0)