fix: Fixup Error Message#100
Open
irishgordo wants to merge 1 commit into
Open
Conversation
* as we start to embark on actually having more visibility into systems via logs, metrics, traces, & alerts - we've noticed that likely the error message needs to be updated for the message to make more sense as it's ingested into Loki or other places Resolves: fix/fixup-error-message Signed-off-by: Mike Russell <michael.russell@suse.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes an error message that had its formatting arguments swapped, causing the "expected" and "found" node counts to be reported incorrectly.
Changes:
- Swap the order of
len(nl.Items)andlen(c.Spec.Nodes)in the error message inmarkClusterReadyso the expected/found counts are accurate.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
khushboo-rancher
approved these changes
May 29, 2026
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.
Resolves: fix/fixup-error-message
Example:
{"level":"error","ts":"2026-05-06T19:19:28Z","msg":"Reconciler error","controller":"cluster","controllerGroup":"metal.harvesterhci.io","controllerKind":"Cluster","Cluster":{"name":"giants-tclgi","namespace":"tink-system"},"namespace":"tink-system","name":"giants-tclgi","reconcileID":"8e57d911-98aa-4f1c-a179-5ee1d6ebf216","error":"api server is running, expected to find 2 nodes but only found 3 nodes","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.22.5/pkg/internal/controller/controller.go:474\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.22.5/pkg/internal/controller/controller.go:421\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func1.1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.22.5/pkg/internal/controller/controller.go:296"}It can be noticed, that at the time on May 6th 2026, giants-* cluster it had "3" nodes included in the cluster manifest.
But the error that's bubbling up likely needs to have the numbers reversed to read something like:
^ which would make more sense.
This PR just flips the numbers around that get interpolated into the error message string - likely fixing the weirdness we were seeing with our logs.
As we likely will see more similar things with our systems, but the idea is we're trying to embark on actually having visibility with alerting / metrics / logs / (maybe future state traces) to our internal systems - to help us stay ahead of the curve vs. behind it - help us have more places for forensics as well when we run into issues.
cc: @harvester/qa