Skip to content

fix: Fixup Error Message#100

Open
irishgordo wants to merge 1 commit into
harvester:mainfrom
irishgordo:fix/fixup-error-message
Open

fix: Fixup Error Message#100
irishgordo wants to merge 1 commit into
harvester:mainfrom
irishgordo:fix/fixup-error-message

Conversation

@irishgordo
Copy link
Copy Markdown
Contributor

  • 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

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:

expected to find 3 nodes but only found 2

^ 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

* 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>
Copilot AI review requested due to automatic review settings May 29, 2026 21:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) and len(c.Spec.Nodes) in the error message in markClusterReady so the expected/found counts are accurate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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