mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-04 16:53:25 +00:00
fix: use-case while in cluster, connecting to an external (#623)
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com> Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ func (c *Client) GetRestClient() rest.Interface {
|
||||
func NewClient(kubecontext string, kubeconfig string) (*Client, error) {
|
||||
var config *rest.Config
|
||||
config, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
if kubeconfig != "" || err != nil {
|
||||
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
|
||||
|
||||
if kubeconfig != "" {
|
||||
|
Reference in New Issue
Block a user