0

我正试图让SkyDNSv1起死回生,并从我的 fork 构建它(这里是Dockerfile)。SkyDNS 是一个非常好的和简单的快速服务发现工具,但它很长时间没有更新。

构建过程中存在错误,它是由第三方库引起的。我无法弄清楚为什么会这样:

$ docker build --no-cache -t skydns1 .
Sending build context to Docker daemon 1.566 MB
Sending build context to Docker daemon 
Step 0 : FROM golang:1.4.2
 ---> 3e8cb8e0c765
Step 1 : WORKDIR /go/src
 ---> Running in 3a06cf460ad9
 ---> 1dd14a099164
Removing intermediate container 3a06cf460ad9
Step 2 : RUN go get github.com/codegangsta/cli
 ---> Running in eabcfd6fe621
 ---> c9ea222f2d74
Removing intermediate container eabcfd6fe621
Step 3 : RUN go get github.com/vitalyisaev2/skydns1
 ---> Running in 3264582b2e7a
# github.com/rcrowley/go-metrics/influxdb
github.com/rcrowley/go-metrics/influxdb/influxdb.go:19: undefined: client.ClientConfig
github.com/rcrowley/go-metrics/influxdb/influxdb.go:38: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:44: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:52: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:60: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:70: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:82: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:93: undefined: client.Series
github.com/rcrowley/go-metrics/influxdb/influxdb.go:106: client.WriteSeries undefined (type *client.Client has no field or method WriteSeries)
INFO[0075] The command [/bin/sh -c go get github.com/vitalyisaev2/skydns1] returned a non-zero code: 

但是如果你查看导致这个错误的文件,你会注意到 Golang 对influxdb/client. 我认为编译器不会像应该那样client替换导入的名称:influxClient

package influxdb

import (
    "fmt"
    influxClient "github.com/influxdb/influxdb/client"
    "github.com/rcrowley/go-metrics"
    "log"
    "time"
) 

可能我只是错过了一个明显的错误。任何帮助将不胜感激。

4

1 回答 1

3

Go 编译器不会替换或重写任何东西,代码就是错误的。该github.com/rcrowley/go-metrics/influxdb软件包是使用其他一些不再存在的 influxdb 客户端代码编写的。(看起来已经有几个 github 问题公开了)

如果您查看当前的influxdb/client包,您会发现没有Series,ClientConfig或根本没有Client.WriteSeries。您需要删除依赖项github.com/rcrowley/go-metrics/influxdb才能构建您的项目。

于 2015-06-18T19:13:24.573 回答