diff --git a/cluster/kubernetes/scoper.go b/cluster/kubernetes/scoper.go index c2c16ec71a..dc47faa62d 100644 --- a/cluster/kubernetes/scoper.go +++ b/cluster/kubernetes/scoper.go @@ -8,7 +8,7 @@ import ( ) type Scoper struct { - Client *discovery.DiscoveryClient + Client discovery.ServerResourcesInterface } func (s *Scoper) Scope(groupVersion string, kind string) (int, error) { diff --git a/cmd/fluxd/main.go b/cmd/fluxd/main.go index a3d68f680b..2dd49926bb 100644 --- a/cmd/fluxd/main.go +++ b/cmd/fluxd/main.go @@ -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" @@ -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()}, } }