Skip to content
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

🌱 Better error message if CSR could not find machine. #1290

Merged

Conversation

guettli
Copy link
Contributor

@guettli guettli commented May 2, 2024

What this PR does / why we need it:

Better error message if CSR could not find machine.

From this log (converted from json to yaml), you don' know which machine was not found.

level: ERROR
time: "2024-05-02T12:41:30.204Z"
file: controllers/csr_controller.go:108
message: could not find an associated bm machine or hcloud machine
controller: certificatesigningrequest
controllerGroup: certificates.k8s.io
controllerKind: CertificateSigningRequest
"CertificateSigningRequest": {"name": "csr-7wttr"}
namespace: ""
name: csr-7wttr
reconcileID: 4f67ee9f-f920-4a32-8bac-36e7dfa38ee6
CertificateSigningRequest:
  name: csr-7wttr
userName: system:node:guettli-1
error: failed to get hcloud and bare metal machine
stacktrace: |-
  github.com/syself/cluster-api-provider-hetzner/controllers.(*GuestCSRReconciler).Reconcile
  	github.com/syself/cluster-api-provider-hetzner/controllers/csr_controller.go:108
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

This PR adds the hcloud and bm-machine name.

@guettli guettli requested a review from janiskemper May 2, 2024 13:21
@janiskemper janiskemper force-pushed the tg/csr-reconciler-get-machine-addresses--better-err-msg branch from e0eaa96 to 764e099 Compare May 7, 2024 07:16
@janiskemper janiskemper marked this pull request as ready for review May 7, 2024 07:16
@syself-bot syself-bot bot added the area/code Changes made in the code directory label May 7, 2024
@guettli guettli merged commit 79d8199 into main May 7, 2024
11 of 14 checks passed
@guettli guettli deleted the tg/csr-reconciler-get-machine-addresses--better-err-msg branch May 7, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code Changes made in the code directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants