bug: handle errors when SyncMode is set to DryRun#1885
Merged
Conversation
DryRun ClusterReports were left unpopulated whenever a resource's dry-run apply failed (e.g. a StatefulSet update rejected with `Forbidden: updates to statefulset spec for fields other than ... are forbidden`). The failure surfaced correctly on `ClusterSummary.Status.FeatureSummaries[].FailureMessage`, but `ClusterReport.Status.ResourceReports` never got written, because `postProcessDeployedResources` returned early on `deployError` before reaching the call that persists the report. This fixes both: - `deployUnstructured` now records an `Error`-action `ResourceReport` (with the apply error as the message) for a resource whose dry-run apply fails, but only in `SyncMode: DryRun` - `postProcessDeployedResources` now persists whatever `ResourceReports` were gathered before returning the deploy error, instead of skipping the ClusterReport update entirely.
gianlucam76
force-pushed
the
dry-run-error
branch
from
July 23, 2026 07:34
a1f3df0 to
25aad2c
Compare
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DryRun ClusterReports were left unpopulated whenever a resource's dry-run apply failed (e.g. a StatefulSet update rejected with
Forbidden: updates to statefulset spec for fields other than ... are forbidden). The failure surfaced correctly onClusterSummary.Status.FeatureSummaries[].FailureMessage, butClusterReport.Status.ResourceReportsnever got written, becausepostProcessDeployedResourcesreturned early ondeployErrorbefore reaching the call that persists the report.This fixes both:
deployUnstructurednow records anError-actionResourceReport(with the apply error as the message) for a resource whose dry-run apply fails, but only inSyncMode: DryRunpostProcessDeployedResourcesnow persists whateverResourceReportswere gathered before returning the deploy error, instead of skipping the ClusterReport update entirely.