Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Reuse discovery client from k8s client set
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Jan 22, 2019
1 parent 83a750b commit a936989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cluster/kubernetes/scoper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

type Scoper struct {
Client *discovery.DiscoveryClient
Client discovery.ServerResourcesInterface
}

func (s *Scoper) Scope(groupVersion string, kind string) (int, error) {
Expand Down
11 changes: 3 additions & 8 deletions cmd/fluxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/go-kit/kit/log"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/pflag"
k8sifclient "github.com/weaveworks/flux/integrations/client/clientset/versioned"
"k8s.io/client-go/discovery"
k8sclient "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

k8sifclient "github.com/weaveworks/flux/integrations/client/clientset/versioned"

"github.com/weaveworks/flux/checkpoint"
"github.com/weaveworks/flux/cluster"
"github.com/weaveworks/flux/cluster/kubernetes"
Expand Down Expand Up @@ -273,16 +273,11 @@ func main() {

k8s = k8sInst
imageCreds = k8sInst.ImagesToFetch
k8sDiscoveryClient, err := discovery.NewDiscoveryClientForConfig(restClientConfig)
if err != nil {
logger.Log("err", err)
os.Exit(1)
}
// There is only one way we currently interpret a repo of
// files as manifests, and that's as Kubernetes yamels.
k8sManifests = &kubernetes.Manifests{
AllowedNamespaces: allowedNamespaces,
Scoper: &kubernetes.Scoper{Client: k8sDiscoveryClient},
Scoper: &kubernetes.Scoper{Client: clientset.Discovery()},
}
}

Expand Down

0 comments on commit a936989

Please sign in to comment.