Skip to content

Commit eeb1b9d

Browse files
yevgeny-shnaidmank8s-ci-robot
authored andcommitted
Changing the Generation and ObservedGeneration
Removing generation and observed generation from Image Spec and Status. Adding new Regeneration field in the Spec which will be used for kicking off a new round of reconciliation. If the image status is "does not exists, the reconcilaition can be re-triggered, even if no objects monitored by the reconciler have been changed (image pushed to repo, Build/Sign dockerfile changed, etc')
1 parent 15e834f commit eeb1b9d

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

api/v1beta1/moduleimagesconfig_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ const (
4040
type ModuleImageSpec struct {
4141
// image
4242
Image string `json:"image"`
43-
// generation counter of the image config
44-
Generation string `json:"generation"`
4543

4644
// Build contains build instructions, in case image needs building
4745
// +optional
@@ -56,6 +54,9 @@ type ModuleImageSpec struct {
5654
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
5755
// +kubebuilder:validation:Required
5856
type ModuleImagesConfigSpec struct {
57+
// updating counter triggers a new reconcilation
58+
Generation int64 `json:"regeneration"`
59+
5960
Images []ModuleImageSpec `json:"images"`
6061

6162
// ImageRepoSecret contains pull secret for the image's repo, if needed
@@ -69,8 +70,6 @@ type ModuleImageState struct {
6970
// status of the image
7071
// one of: Exists, notExists
7172
Status ImageState `json:"status"`
72-
// observedGeneration counter is updated on each status update
73-
ObservedGeneration string `json:"observedGeneration"`
7473
}
7574

7675
// ModuleImagesConfigStatus describes the status of the images that need to be verified (defined in the spec)

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ spec:
153153
required:
154154
- dockerfileConfigMap
155155
type: object
156-
generation:
157-
description: generation counter of the image config
158-
type: string
159156
image:
160157
description: image
161158
type: string
@@ -222,12 +219,16 @@ spec:
222219
- keySecret
223220
type: object
224221
required:
225-
- generation
226222
- image
227223
type: object
228224
type: array
225+
regeneration:
226+
description: updating counter triggers a new reconcilation
227+
format: int64
228+
type: integer
229229
required:
230230
- images
231+
- regeneration
231232
type: object
232233
status:
233234
description: |-
@@ -240,18 +241,13 @@ spec:
240241
image:
241242
description: image
242243
type: string
243-
observedGeneration:
244-
description: observedGeneration counter is updated on each status
245-
update
246-
type: string
247244
status:
248245
description: |-
249246
status of the image
250247
one of: Exists, notExists
251248
type: string
252249
required:
253250
- image
254-
- observedGeneration
255251
- status
256252
type: object
257253
type: array

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ spec:
153153
required:
154154
- dockerfileConfigMap
155155
type: object
156-
generation:
157-
description: generation counter of the image config
158-
type: string
159156
image:
160157
description: image
161158
type: string
@@ -222,12 +219,16 @@ spec:
222219
- keySecret
223220
type: object
224221
required:
225-
- generation
226222
- image
227223
type: object
228224
type: array
225+
regeneration:
226+
description: updating counter triggers a new reconcilation
227+
format: int64
228+
type: integer
229229
required:
230230
- images
231+
- regeneration
231232
type: object
232233
status:
233234
description: |-
@@ -240,18 +241,13 @@ spec:
240241
image:
241242
description: image
242243
type: string
243-
observedGeneration:
244-
description: observedGeneration counter is updated on each status
245-
update
246-
type: string
247244
status:
248245
description: |-
249246
status of the image
250247
one of: Exists, notExists
251248
type: string
252249
required:
253250
- image
254-
- observedGeneration
255251
- status
256252
type: object
257253
type: array

0 commit comments

Comments
 (0)