Skip to content

Commit

Permalink
Changing the Generation and ObservedGeneration
Browse files Browse the repository at this point in the history
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')
  • Loading branch information
yevgeny-shnaidman authored and k8s-ci-robot committed Jan 23, 2025
1 parent 15e834f commit eeb1b9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
7 changes: 3 additions & 4 deletions api/v1beta1/moduleimagesconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const (
type ModuleImageSpec struct {
// image
Image string `json:"image"`
// generation counter of the image config
Generation string `json:"generation"`

// Build contains build instructions, in case image needs building
// +optional
Expand All @@ -56,6 +54,9 @@ type ModuleImageSpec struct {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +kubebuilder:validation:Required
type ModuleImagesConfigSpec struct {
// updating counter triggers a new reconcilation
Generation int64 `json:"regeneration"`

Images []ModuleImageSpec `json:"images"`

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

// ModuleImagesConfigStatus describes the status of the images that need to be verified (defined in the spec)
Expand Down
14 changes: 5 additions & 9 deletions config/crd/bases/kmm.sigs.x-k8s.io_modulebuildsignconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ spec:
required:
- dockerfileConfigMap
type: object
generation:
description: generation counter of the image config
type: string
image:
description: image
type: string
Expand Down Expand Up @@ -222,12 +219,16 @@ spec:
- keySecret
type: object
required:
- generation
- image
type: object
type: array
regeneration:
description: updating counter triggers a new reconcilation
format: int64
type: integer
required:
- images
- regeneration
type: object
status:
description: |-
Expand All @@ -240,18 +241,13 @@ spec:
image:
description: image
type: string
observedGeneration:
description: observedGeneration counter is updated on each status
update
type: string
status:
description: |-
status of the image
one of: Exists, notExists
type: string
required:
- image
- observedGeneration
- status
type: object
type: array
Expand Down
14 changes: 5 additions & 9 deletions config/crd/bases/kmm.sigs.x-k8s.io_moduleimagesconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ spec:
required:
- dockerfileConfigMap
type: object
generation:
description: generation counter of the image config
type: string
image:
description: image
type: string
Expand Down Expand Up @@ -222,12 +219,16 @@ spec:
- keySecret
type: object
required:
- generation
- image
type: object
type: array
regeneration:
description: updating counter triggers a new reconcilation
format: int64
type: integer
required:
- images
- regeneration
type: object
status:
description: |-
Expand All @@ -240,18 +241,13 @@ spec:
image:
description: image
type: string
observedGeneration:
description: observedGeneration counter is updated on each status
update
type: string
status:
description: |-
status of the image
one of: Exists, notExists
type: string
required:
- image
- observedGeneration
- status
type: object
type: array
Expand Down

0 comments on commit eeb1b9d

Please sign in to comment.