-
Notifications
You must be signed in to change notification settings - Fork 525
OCPBUGS-116462: fix extension verification during non-boot sync and harden error handling #6498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -884,6 +884,25 @@ func (dn *Daemon) syncNode(key string) error { | |
| } | ||
|
|
||
| } else { | ||
| if dn.os.IsCoreOSVariant() { | ||
| if odc, odcErr := dn.getCurrentConfigOnDisk(); odcErr == nil && odc != nil { | ||
| coreOSDaemon := CoreOSDaemon{dn} | ||
| if verifyErr := coreOSDaemon.verifyExtensionPackages(odc.currentConfig); verifyErr != nil { | ||
| return fmt.Errorf("extension package verification failed: %w", verifyErr) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if dn.node.Annotations[constants.MachineConfigDaemonStateAnnotationKey] == constants.MachineConfigDaemonStateDegraded { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Limit degraded-state clearing to extension verification. This block runs outside the Gate this transition on the extension-verification path and the extension-specific degraded reason. The PR objective requires degraded-state clearing to be scoped to extension-related degradation. 🤖 Prompt for AI Agents |
||
| annos := map[string]string{ | ||
| constants.MachineConfigDaemonStateAnnotationKey: constants.MachineConfigDaemonStateDone, | ||
| constants.MachineConfigDaemonReasonAnnotationKey: "", | ||
| } | ||
| if _, setErr := dn.nodeWriter.SetAnnotations(annos); setErr != nil { | ||
| klog.Errorf("Failed to clear degraded state after successful sync: %v", setErr) | ||
| } | ||
|
Comment on lines
+901
to
+903
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Propagate annotation update failures. When Return a wrapped error so the failed state transition is not treated as successful. As per path instructions, Go code must never ignore error returns. The PR objective also requires annotation-setting errors to propagate. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
|
|
||
| err = upgrademonitor.GenerateAndApplyMachineConfigNodes( | ||
| &upgrademonitor.Condition{State: mcfgv1.MachineConfigNodeUpdated, Reason: string(mcfgv1.MachineConfigNodeUpdated), Message: fmt.Sprintf("Node %s Updated", dn.node.GetName())}, | ||
| nil, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Propagate on-disk configuration errors.
This condition treats every
getCurrentConfigOnDiskerror as “no configuration.” A malformed configuration or a current-image read failure therefore skips extension verification and allows the sync to continue.Handle only
os.IsNotExistas an absent configuration. Return other errors.Proposed fix
As per path instructions, Go code must never ignore error returns.
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Path instructions