beldur / kube2consul

A bridge between Kubernetes and Consul
MIT License
58 stars 5 forks source link

kube2consul.go:56: cannot use s.Spec.Ports[0].Port (type int32) as type int in assignment #1

Closed pboguk closed 8 years ago

pboguk commented 8 years ago

Hi,

There is an error during build: kube2consul.go:56: cannot use s.Spec.Ports[0].Port (type int32) as type int in assignment

I fixed it by changing service.Port = s.Spec.Ports[0].Port to service.Port = int(s.Spec.Ports[0].Port)

WBR

beldur commented 8 years ago

There seems to have happened a change in the k8 Port type from int to int32 (see: https://github.com/kubernetes/kubernetes/commit/cf133ee03ac99056a50861222581b64209eebc5b#diff-9ff06ad723720f9428a65da3710cf436R1538)

int is platform dependent (either uint32 or uint64 see: https://golang.org/ref/spec#Numeric_types) and used by consul.

I will add the type conversion as you suggested.