tczekajlo / kube-consul-register

a tool to register Kubernetes PODs as Consul Services
Apache License 2.0
105 stars 50 forks source link

Trouble to build master #10

Closed donch closed 7 years ago

donch commented 7 years ago

Hello !

I'm trying kube-consul-register to register Services with node_port into my Consul cluster. If i'm not wrong, it's a feature you have merged few weeks ago. So i'm trying to build the master branch but i have some troubles.

I'll try to explain all the steps i've done to build the project (i'm a beginer in Golang)

mkdir /root/work/go/ && cd /root/work/go/
export GOPATH=`pwd`
mkdir src && cd src
git clone https://github.com/tczekajlo/kube-consul-register.git
cd kube-consul-register/
glide install --strip-vendor
go get -v
make

The project starts to build but i have the following error :

# kube-consul-register
./main.go:49: cannot use metrics.ConsulFailure (type *"github.com/prometheus/client_golang/prometheus".CounterVec) as type "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector in argument to "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".MustRegister:
    *"github.com/prometheus/client_golang/prometheus".CounterVec does not implement "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
        have Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
        want Collect(chan<- "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Metric)
./main.go:50: cannot use metrics.ConsulSuccess (type *"github.com/prometheus/client_golang/prometheus".CounterVec) as type "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector in argument to "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".MustRegister:
    *"github.com/prometheus/client_golang/prometheus".CounterVec does not implement "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
        have Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
        want Collect(chan<- "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Metric)
./main.go:51: cannot use metrics.PodFailure (type *"github.com/prometheus/client_golang/prometheus".CounterVec) as type "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector in argument to "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".MustRegister:
    *"github.com/prometheus/client_golang/prometheus".CounterVec does not implement "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
        have Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
        want Collect(chan<- "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Metric)
./main.go:52: cannot use metrics.PodSuccess (type *"github.com/prometheus/client_golang/prometheus".CounterVec) as type "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector in argument to "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".MustRegister:
    *"github.com/prometheus/client_golang/prometheus".CounterVec does not implement "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
        have Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
        want Collect(chan<- "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Metric)
./main.go:53: cannot use metrics.FuncDuration (type *"github.com/prometheus/client_golang/prometheus".SummaryVec) as type "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector in argument to "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".MustRegister:
    *"github.com/prometheus/client_golang/prometheus".SummaryVec does not implement "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
        have Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
        want Collect(chan<- "kube-consul-register/vendor/github.com/prometheus/client_golang/prometheus".Metric)
./main.go:91: cannot use clientset (type *"kube-consul-register/vendor/k8s.io/client-go/kubernetes".Clientset) as type *"github.com/tczekajlo/kube-consul-register/vendor/k8s.io/client-go/kubernetes".Clientset in argument to config.Load
./main.go:106: cannot use clientset (type *"kube-consul-register/vendor/k8s.io/client-go/kubernetes".Clientset) as type *"github.com/tczekajlo/kube-consul-register/vendor/k8s.io/client-go/kubernetes".Clientset in argument to ctrInstance.New
Makefile:28: recipe for target 'dist/kube-consul-controller' failed

Is there something i've missed ?

Thanks for you support

donch commented 7 years ago

After several tries, i've finally found how to build it !

Sorry for the inconvenience

webbrandon commented 6 years ago

I am stuck on same issue. Expect its my inexperience dealing with go packages, I should be able to resolve soon enough but if you could share.