FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Behaviour of paused: true when there are empty providerConfig.machineImages by yahor-kurachkin · Pull Request #55 · cobaltcore-dev/cloud-profile-sync · GitHub

fix: Behaviour of paused: true when there are empty providerConfig.machineImages - #55

Merged
yahor-kurachkin merged 2 commits into
cobaltcore-dev:masterfrom
yahor-kurachkin:fix-paused-behaviour
Sep 10, 2026
Merged

fix: Behaviour of paused: true when there are empty providerConfig.machineImages#55
yahor-kurachkin merged 2 commits into
cobaltcore-dev:masterfrom
yahor-kurachkin:fix-paused-behaviour

Conversation

yahor-kurachkin commented Sep 8, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings September 8, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🟡 Changes recommended

The new ProviderConfig restore code can unintentionally drop unrelated ProviderConfig fields by round-tripping through a partial JSON struct, risking configuration loss.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Ensures that when a MachineImageUpdate is marked Paused: true, the reconciler preserves runtime-discovered provider machineImages mappings stored in the existing CloudProfile.Spec.ProviderConfig instead of wiping them when the MCP spec has an empty/omitted provider config machineImages list.

Changes:

  • Add logic in the CloudProfile reconciliation path to restore stored ProviderConfig machineImages entries for paused image updates.
  • Extend the paused-update controller test to simulate an already-reconciled CloudProfile with ProviderConfig mappings and assert they remain intact after a paused reconcile.
File summaries
File Description
controllers/managedcloudprofile_controller_test.go Adds a regression test verifying paused reconciles preserve existing ProviderConfig image mappings.
controllers/cloud_profile.go Restores stored ProviderConfig machineImages for paused updates via JSON manipulation helpers.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread controllers/cloud_profile.go Outdated
Copilot AI review requested due to automatic review settings September 8, 2026 11:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🟢 Approval recommended

The change is narrowly scoped, adds coverage for the intended regression scenario, and the reconciliation logic preserves the previously stored ProviderConfig mappings as intended.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Signed-off-by: C5421281 <yahor.kurachkin@sap.com>
Copilot AI review requested due to automatic review settings September 10, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🟡 Changes recommended

Critical compatibility and paused-reconciliation issues remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread api/v1alpha1/managedcloudprofile.go Outdated
Comment thread controllers/cloud_profile.go Outdated
Comment thread controllers/cloud_profile.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🟡 Changes recommended

Address the legacy pause-field compatibility break and correctly detect existing CloudProfiles with empty fields.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

…images update

Signed-off-by: C5421281 <yahor.kurachkin@sap.com>
Copilot AI review requested due to automatic review settings September 10, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🔵 Needs a closer look

Address the breaking API migration and paused reconciliation fallback issues before approval.

Review details

Suppressed comments (2)

api/v1alpha1/managedcloudprofile.go:20

  • Adding the global flag while removing MachineImageUpdate.Paused is a breaking API change: after this CRD is upgraded, Kubernetes will prune existing machineImageUpdates[].paused: true fields and this controller will silently resume those updates. Please retain/deprecate the old field and map it to the new semantics, or provide an explicit migration before removing it.
	// MachineImagesPaused disables automatic machine image updates and keeps the
	// existing CloudProfile machine images and provider config unchanged. Other
	// updates (e.g. Kubernetes versions and base spec fields) still apply.
	// +optional
	MachineImagesPaused bool `json:"machineImagesPaused,omitempty"`

controllers/cloud_profile.go:67

  • This fallback conflates a newly created CloudProfile with an existing one whose machineImages is empty or whose ProviderConfig is nil. With the pause enabled, such an existing object is overwritten by the MCP base values, despite the field contract saying both values remain unchanged. Detect whether CreateOrPatch found an existing object (for example, via ResourceVersion) and restore both fields, including nil/empty values, in that case.
			if len(storedMachineImages) > 0 {
				cloudProfile.Spec.MachineImages = storedMachineImages
			}
			if storedProviderConfig != nil {
				cloudProfile.Spec.ProviderConfig = storedProviderConfig
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

yahor-kurachkin merged commit f6f276a into cobaltcore-dev:master Sep 10, 2026
7 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL