Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions crd/cloudprofilesync.cobaltcore.dev_managedcloudprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -516,25 +516,27 @@ spec:
- kubernetes
- type
type: object
garbageCollection:
description: GarbageCollection contains configuration for automated
garbage collection
properties:
enabled:
description: Enabled toggles garbage collection for this resource.
type: boolean
Comment thread
coderabbitai[bot] marked this conversation as resolved.
maxAge:
description: |-
MaxAge defines the maximum age for images to keep. Images older than
now - MaxAge are eligible for deletion.
type: string
x-kubernetes-validations:
- message: maxAge must not be negative
rule: duration(self) >= duration('0s')
type: object
Comment on lines +519 to +534

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Ship an upgrade path for the field move.

api/v1alpha1/managedcloudprofile.go:16-26 now exposes this config on ManagedCloudProfileSpec, while api/v1alpha1/managedcloudprofile.go:94-104 no longer keeps it on MachineImageUpdate. Updating the CRD alone will not rewrite stored v1alpha1 objects, so existing resources using the old nested field will be ignored by controllers built from the new type until they are migrated. Please add a migration/conversion path or keep backward-compatible handling for one release.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crd/cloudprofilesync.cobaltcore.dev_managedcloudprofiles.yaml` around lines
519 - 534, The new CRD moved garbageCollection from MachineImageUpdate into
ManagedCloudProfileSpec which leaves stored v1alpha1 objects with the old nested
field unread by the updated controller; add a migration/conversion path or
backwards-compatible handling: implement a conversion/migration that reads the
legacy MachineImageUpdate.garbageCollection and writes it into
ManagedCloudProfileSpec.garbageCollection during upgrade (or add code in the
reconciliation path to detect the old nested field and map it to the new
ManagedCloudProfileSpec field), reference the types ManagedCloudProfileSpec and
MachineImageUpdate in your conversion logic, and ensure this runs once during
controller start or via a conversion webhook so existing persisted v1alpha1
resources are migrated for one release.

machineImageUpdates:
description: MachineImageUpdates contains the source and provider
information to automate machine images.
items:
properties:
garbageCollection:
description: GarbageCollection contains configuration for automated
garbage collection
properties:
enabled:
description: Enabled toggles garbage collection for this
image.
type: boolean
maxAge:
description: |-
MaxAge defines the maximum age for images to keep. Images older than
now MaxAge are eligible for deletion.
type: string
type: object
imageName:
description: ImagesName is the name of the image to maintain
automatically
Expand Down
Loading