Skip to content

Commit

Permalink
k8s: return InClusterConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
apetruhin committed Jun 26, 2024
1 parent 88adf15 commit abdf86b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions discovery/k8s.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package discovery

import (
"os"
"path/filepath"
"sync"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/clientcmd"
)

type PodEventType int
Expand Down Expand Up @@ -41,8 +39,7 @@ type K8S struct {
}

func NewK8S() (*K8S, error) {
//config, err := rest.InClusterConfig()
config, err := clientcmd.BuildConfigFromFlags("", filepath.Join(os.Getenv("HOME"), ".kube", "config"))
config, err := rest.InClusterConfig()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit abdf86b

Please sign in to comment.