mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-07 02:01:39 +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) {
|
func NewClient(kubecontext string, kubeconfig string) (*Client, error) {
|
||||||
var config *rest.Config
|
var config *rest.Config
|
||||||
config, err := rest.InClusterConfig()
|
config, err := rest.InClusterConfig()
|
||||||
if err != nil {
|
if kubeconfig != "" || err != nil {
|
||||||
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
|
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
|
||||||
|
|
||||||
if kubeconfig != "" {
|
if kubeconfig != "" {
|
||||||
|
Reference in New Issue
Block a user