Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"flag"
"log"

"k8s.io/client-go/tools/clientcmd"
"knative.dev/eventing-operator/pkg/reconciler/knativeeventing"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/signals"
Expand All @@ -28,7 +27,7 @@ import (
func main() {
flag.Parse()

cfg, err := clientcmd.BuildConfigFromFlags(*knativeeventing.MasterURL, *knativeeventing.Kubeconfig)
cfg, err := sharedmain.GetConfig(*knativeeventing.MasterURL, *knativeeventing.Kubeconfig)
if err != nil {
log.Fatal("Error building kubeconfig", err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/knativeeventing/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ package knativeeventing
import (
"context"
"flag"
"knative.dev/pkg/injection/sharedmain"
"os"
"path/filepath"

mf "github.com/manifestival/manifestival"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/clientcmd"
"knative.dev/eventing-operator/pkg/apis/eventing/v1alpha1"
knativeEventinginformer "knative.dev/eventing-operator/pkg/client/injection/informers/eventing/v1alpha1/knativeeventing"
rbase "knative.dev/eventing-operator/pkg/reconciler"
Expand All @@ -39,7 +39,7 @@ const (
var (
recursive = flag.Bool("recursive", false, "If filename is a directory, process all manifests recursively")
MasterURL = flag.String("master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
Kubeconfig = flag.String("kubeconfig", os.Getenv("KUBECONFIG"), "Path to a kubeconfig. Only required if out-of-cluster.")
Kubeconfig = flag.String("kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.")
)

// NewController initializes the controller and is called by the generated code
Expand All @@ -59,7 +59,7 @@ func NewController(

koDataDir := os.Getenv("KO_DATA_PATH")

cfg, err := clientcmd.BuildConfigFromFlags(*MasterURL, *Kubeconfig)
cfg, err := sharedmain.GetConfig(*MasterURL, *Kubeconfig)
if err != nil {
c.Logger.Error(err, "Error building kubeconfig")
}
Expand Down