Skip to content

Commit

Permalink
avoid cache reset every 1 minute by not using operator framework
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Sep 14, 2020
1 parent 334cab5 commit 34f573c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/k8sapi/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (

clientset "k8s.io/client-go/kubernetes"

"github.com/operator-framework/operator-sdk/pkg/k8sclient"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"

Expand Down Expand Up @@ -83,7 +83,12 @@ func NewController(clientset kubernetes.Interface) *Controller {

// CreateKubeClient creates a k8s client
func CreateKubeClient() (clientset.Interface, error) {
kubeClient := k8sclient.GetKubeClient()
kubeConfig, err := rest.InClusterConfig()
if err != nil {
panic(err)
}
kubeClient := kubernetes.NewForConfigOrDie(kubeConfig)

// Informers don't seem to do a good job logging error messages when it
// can't reach the server, making debugging hard. This makes it easier to
// figure out if apiserver is configured incorrectly.
Expand Down

0 comments on commit 34f573c

Please sign in to comment.