Skip to content

Comments

feat: Show a friendly message when not connected into any cluster#199

Open
matheusandre1 wants to merge 1 commit intokgrep-org:mainfrom
matheusandre1:issue97
Open

feat: Show a friendly message when not connected into any cluster#199
matheusandre1 wants to merge 1 commit intokgrep-org:mainfrom
matheusandre1:issue97

Conversation

@matheusandre1
Copy link

Closes: #97

Hello @hbelmiro , Is this acceptable, or do you need to use slog?

@hbelmiro hbelmiro requested a review from Copilot February 18, 2026 14:57
@hbelmiro
Copy link
Collaborator

That's probably enough. Thank you @matheusandre1.
I'll try to take a look by the end of this week.

Copy link
Contributor

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

This PR addresses issue #97 by implementing user-friendly error messages when users are not connected to a Kubernetes cluster. The changes introduce an error wrapping mechanism that translates technical Kubernetes API errors into human-readable messages.

Changes:

  • Added a new WrapKubernetesError function to detect and wrap common Kubernetes errors (unauthorized, forbidden, missing configuration)
  • Applied error wrapping to all Kubernetes API calls in resource_searcher.go that create configs, list resources, or discover APIs
  • Error messages now guide users to check authentication, permissions, or kubeconfig setup

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/resource/errors.go New file implementing WrapKubernetesError function to provide user-friendly error messages for Kubernetes API errors
internal/resource/resource_searcher.go Updated all error returns from Kubernetes API calls to wrap errors through WrapKubernetesError

💡 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.

Show a friendly message when not connected into any cluster

2 participants