Skip to content

Commit 567be9d

Browse files
yevgeny-shnaidmank8s-ci-robot
authored andcommitted
adding field needed for build and sign flow the MIC object
MIC reconciler is watching the MIC object. it should receive all the needed info for its action from the MIC, it does not need to access the Module object at all
1 parent 21b8e5c commit 567be9d

File tree

3 files changed

+197
-1
lines changed

3 files changed

+197
-1
lines changed

api/v1beta1/moduleimagesconfig_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
v1 "k8s.io/api/core/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -35,13 +36,25 @@ type ModuleImageSpec struct {
3536
Image string `json:"image"`
3637
// generation counter of the image config
3738
Generation int `json:"generation"`
39+
40+
// Build contains build instructions, in case image needs building
41+
// +optional
42+
Build *Build `json:"build,omitempty"`
43+
44+
// Sign contains sign instructions, in case image needs signing
45+
// +optional
46+
Sign *Sign `json:"sign,omitempty"`
3847
}
3948

4049
// ModuleImagesConfigSpec describes the images of the Module whose status needs to be verified
4150
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
4251
// +kubebuilder:validation:Required
4352
type ModuleImagesConfigSpec struct {
4453
Images []ModuleImageSpec `json:"images"`
54+
55+
// ImageRepoSecret contains pull secret for the image's repo, if needed
56+
// +optional
57+
ImageRepoSecret *v1.LocalObjectReference `json:"imageRepoSecret,omitempty"`
4558
}
4659

4760
type ModuleImageState struct {

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,183 @@ spec:
4444
ModuleImagesConfigSpec describes the images of the Module whose status needs to be verified
4545
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
4646
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
4762
images:
4863
items:
4964
description: ModuleImageSpec describes the image whose state needs
5065
to be queried
5166
properties:
67+
build:
68+
description: Build contains build instructions, in case image
69+
needs building
70+
properties:
71+
baseImageRegistryTLS:
72+
description: BaseImageRegistryTLS contains settings determining
73+
how to access registries of the base images in the build-process'
74+
Dockerfile.
75+
properties:
76+
insecure:
77+
description: If Insecure is true, the operator will
78+
be able to access a registry in an insecure (plain
79+
HTTP) protocol.
80+
type: boolean
81+
insecureSkipTLSVerify:
82+
description: If InsecureSkipTLSVerify, the operator
83+
will accept any certificate provided by the registry.
84+
type: boolean
85+
type: object
86+
buildArgs:
87+
description: BuildArgs is an array of build variables that
88+
are provided to the image building backend.
89+
items:
90+
description: BuildArg represents a build argument used
91+
when building a container image.
92+
properties:
93+
name:
94+
type: string
95+
value:
96+
type: string
97+
required:
98+
- name
99+
- value
100+
type: object
101+
type: array
102+
dockerfileConfigMap:
103+
description: ConfigMap that holds Dockerfile contents
104+
properties:
105+
name:
106+
default: ""
107+
description: |-
108+
Name of the referent.
109+
This field is effectively required, but due to backwards compatibility is
110+
allowed to be empty. Instances of this type with an empty value here are
111+
almost certainly wrong.
112+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
113+
type: string
114+
type: object
115+
x-kubernetes-map-type: atomic
116+
kanikoParams:
117+
description: KanikoParams is used to customize the building
118+
process of the image.
119+
properties:
120+
tag:
121+
description: Kaniko image tag to use when creating the
122+
build Pod
123+
type: string
124+
type: object
125+
secrets:
126+
description: |-
127+
Secrets is an optional list of secrets to be made available to the build system.
128+
Those secrets should be used for private resources such as a private Github repo.
129+
For container registries auth use module.spec.imagePullSecret instead.
130+
items:
131+
description: |-
132+
LocalObjectReference contains enough information to let you locate the
133+
referenced object inside the same namespace.
134+
properties:
135+
name:
136+
default: ""
137+
description: |-
138+
Name of the referent.
139+
This field is effectively required, but due to backwards compatibility is
140+
allowed to be empty. Instances of this type with an empty value here are
141+
almost certainly wrong.
142+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
143+
type: string
144+
type: object
145+
x-kubernetes-map-type: atomic
146+
type: array
147+
selector:
148+
additionalProperties:
149+
type: string
150+
description: Selector describes on which nodes will run
151+
the building process.
152+
type: object
153+
required:
154+
- dockerfileConfigMap
155+
type: object
52156
generation:
53157
description: generation counter of the image config
54158
type: integer
55159
image:
56160
description: image
57161
type: string
162+
sign:
163+
description: Sign contains sign instructions, in case image
164+
needs signing
165+
properties:
166+
certSecret:
167+
description: a secret containing the public key used to
168+
sign kernel modules for secureboot
169+
properties:
170+
name:
171+
default: ""
172+
description: |-
173+
Name of the referent.
174+
This field is effectively required, but due to backwards compatibility is
175+
allowed to be empty. Instances of this type with an empty value here are
176+
almost certainly wrong.
177+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
178+
type: string
179+
type: object
180+
x-kubernetes-map-type: atomic
181+
filesToSign:
182+
description: paths inside the image for the kernel modules
183+
to sign (if ommited all kmods are signed)
184+
items:
185+
type: string
186+
type: array
187+
keySecret:
188+
description: a secret containing the private key used to
189+
sign kernel modules for secureboot
190+
properties:
191+
name:
192+
default: ""
193+
description: |-
194+
Name of the referent.
195+
This field is effectively required, but due to backwards compatibility is
196+
allowed to be empty. Instances of this type with an empty value here are
197+
almost certainly wrong.
198+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
199+
type: string
200+
type: object
201+
x-kubernetes-map-type: atomic
202+
unsignedImage:
203+
description: Image to sign, ignored if a Build is present,
204+
required otherwise
205+
type: string
206+
unsignedImageRegistryTLS:
207+
description: UnsignedImageRegistryTLS contains settings
208+
determining how to access registries of the unsigned image.
209+
properties:
210+
insecure:
211+
description: If Insecure is true, the operator will
212+
be able to access a registry in an insecure (plain
213+
HTTP) protocol.
214+
type: boolean
215+
insecureSkipTLSVerify:
216+
description: If InsecureSkipTLSVerify, the operator
217+
will accept any certificate provided by the registry.
218+
type: boolean
219+
type: object
220+
required:
221+
- certSecret
222+
- keySecret
223+
type: object
58224
required:
59225
- generation
60226
- image

0 commit comments

Comments
 (0)