coredns / alternate

Plugin Alternate is able to selectively forward the query to another upstream server, depending the error result provided by the initial resolver
Apache License 2.0
22 stars 19 forks source link

go get fails #29

Open chris-edwards-pub opened 10 months ago

chris-edwards-pub commented 10 months ago

I am having an issue with "go get github.com/coredns/alternate" It looks like its failing to find the proxy plugin.

github.com/coredns/coredns/plugin/pkg/proxy: cannot find module providing package github.com/coredns/coredns/plugin/pkg/proxy

#12 [builder  8/12] RUN echo "alternate:github.com/coredns/alternate" >> /go/coredns/plugin.cfg
#12 DONE 0.3s

#13 [builder  9/12] RUN go get github.com/coredns/alternate
#13 1.962 go: downloading github.com/coredns/alternate v0.0.0-20230808153232-6204d80011e7
#13 74.71 go: downloading github.com/miekg/dns v1.1.55
#13 74.71 go: downloading golang.org/x/net v0.14.0
#13 74.72 go: downloading google.golang.org/grpc v1.57.0
#13 74.73 go: downloading github.com/prometheus/client_golang v1.16.0
#13 74.74 go: downloading github.com/dnstap/golang-dnstap v0.4.0
#13 75.29 go: downloading google.golang.org/protobuf v1.31.0
#13 75.49 go: downloading golang.org/x/sys v0.11.0
#13 75.49 go: downloading github.com/farsightsec/golang-framestream v0.3.0
#13 75.50 go: downloading golang.org/x/tools v0.9.1
#13 75.64 go: downloading github.com/cespare/xxhash/v2 v2.2.0
#13 75.64 go: downloading github.com/prometheus/client_model v0.4.0
#13 75.64 go: downloading github.com/prometheus/common v0.44.0
#13 75.86 go: downloading github.com/prometheus/procfs v0.10.1
#13 75.89 go: downloading google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130
#13 75.90 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
#13 75.99 go: downloading github.com/golang/protobuf v1.5.3
#13 76.07 go: downloading golang.org/x/text v0.12.0
#13 76.57 go: downloading golang.org/x/mod v0.10.0
#13 77.31 go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20230720185612-659f7aaaa771
#13 82.04 go: github.com/coredns/alternate imports
#13 82.04       github.com/coredns/coredns/plugin/pkg/proxy: cannot find module providing package github.com/coredns/coredns/plugin/pkg/proxy
#13 82.43 go: downloading cloud.google.com/go/compute v1.20.1
#13 82.48 go: downloading github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
#13 82.48 go: downloading github.com/Azure/go-autorest/autorest v0.11.29
#13 82.48 go: downloading github.com/Azure/go-autorest/autorest/adal v0.9.22
#13 82.48 go: downloading github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
#13 82.60 go: downloading github.com/DataDog/datadog-agent/pkg/obfuscate v0.45.0-rc.1
#13 82.60 go: downloading github.com/DataDog/datadog-go/v5 v5.1.1
#13 82.60 go: downloading github.com/Microsoft/go-winio v0.5.2
#13 82.67 go: downloading github.com/antonmedv/expr v1.12.7
#13 82.67 go: downloading github.com/aws/aws-sdk-go v1.44.317
#13 82.68 go: downloading github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534
#13 82.69 go: downloading github.com/dustin/go-humanize v1.0.1
#13 82.73 go: downloading github.com/emicklei/go-restful/v3 v3.10.2
#13 82.75 go: downloading github.com/go-logr/logr v1.2.4
#13 82.76 go: downloading github.com/go-openapi/jsonpointer v0.19.6
#13 82.97 go: downloading github.com/go-openapi/jsonreference v0.20.1
#13 82.98 go: downloading github.com/go-openapi/swag v0.22.3
#13 83.04 go: downloading github.com/golang-jwt/jwt/v4 v4.5.0
#13 83.04 go: downloading github.com/golang/glog v1.1.0
#13 83.05 go: downloading github.com/google/go-cmp v0.5.9
#13 83.10 go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.5
#13 83.10 go: downloading github.com/googleapis/gax-go/v2 v2.12.0
#13 83.10 go: downloading github.com/kr/pretty v0.3.1
#13 83.12 go: downloading github.com/onsi/ginkgo/v2 v2.9.5
#13 83.17 go: downloading github.com/onsi/gomega v1.27.6
#13 83.18 go: downloading github.com/openzipkin-contrib/zipkin-go-opentracing v0.5.0
#13 83.25 go: downloading github.com/openzipkin/zipkin-go v0.4.1
#13 83.26 go: downloading github.com/oschwald/geoip2-golang v1.9.0
#13 83.27 go: downloading github.com/oschwald/maxminddb-golang v1.11.0
#13 83.28 go: downloading github.com/philhofer/fwd v1.1.2
#13 83.32 go: downloading github.com/stretchr/objx v0.5.0
#13 83.33 go: downloading github.com/stretchr/testify v1.8.4
#13 83.35 go: downloading github.com/tinylib/msgp v1.1.8
#13 83.38 go: downloading go.etcd.io/etcd/api/v3 v3.5.9
#13 83.42 go: downloading go.etcd.io/etcd/client/pkg/v3 v3.5.9
#13 83.44 go: downloading go.etcd.io/etcd/client/v3 v3.5.9
#13 83.45 go: downloading go.opencensus.io v0.24.0
#13 83.49 go: downloading go.uber.org/atomic v1.11.0
#13 83.53 go: downloading golang.org/x/crypto v0.12.0
#13 83.54 go: downloading golang.org/x/oauth2 v0.10.0
#13 83.57 go: downloading golang.org/x/sync v0.3.0
#13 83.59 go: downloading golang.org/x/term v0.11.0
#13 83.73 go: downloading golang.org/x/time v0.3.0
#13 83.74 go: downloading golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
#13 83.74 go: downloading google.golang.org/api v0.134.0
#13 83.74 go: downloading gopkg.in/DataDog/dd-trace-go.v1 v1.53.0
#13 83.81 go: downloading inet.af/netaddr v0.0.0-20220811202034-502d2d690317
#13 83.81 go: downloading k8s.io/api v0.27.4
#13 83.95 go: downloading k8s.io/apimachinery v0.27.4
#13 84.06 go: downloading k8s.io/client-go v0.27.4
#13 84.38 go: downloading k8s.io/klog/v2 v2.100.1
#13 84.48 go: downloading k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
#13 84.54 go: downloading k8s.io/utils v0.0.0-20230209194617-a36077c30491
#13 84.68 go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
#13 84.76 go: downloading sigs.k8s.io/yaml v1.3.0
#13 ERROR: process "/bin/sh -ec go get github.com/coredns/alternate" did not complete successfully: exit code: 1
------
 > [builder  9/12] RUN go get github.com/coredns/alternate:
83.74 go: downloading gopkg.in/DataDog/dd-trace-go.v1 v1.53.0
83.81 go: downloading inet.af/netaddr v0.0.0-20220811202034-502d2d690317
83.81 go: downloading k8s.io/api v0.27.4
83.95 go: downloading k8s.io/apimachinery v0.27.4
84.06 go: downloading k8s.io/client-go v0.27.4
84.38 go: downloading k8s.io/klog/v2 v2.100.1
84.48 go: downloading k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
84.54 go: downloading k8s.io/utils v0.0.0-20230209194617-a36077c30491
84.68 go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
84.76 go: downloading sigs.k8s.io/yaml v1.3.0
------
Dockerfile:17
--------------------
  15 |     RUN go get github.com/cloud66-oss/coredns_mysql
  16 |     RUN echo "alternate:github.com/coredns/alternate" >> /go/coredns/plugin.cfg
  17 | >>> RUN go get github.com/coredns/alternate
  18 |     RUN go generate
  19 |     RUN CGO_ENABLED=1 go build
--------------------
chris-edwards-pub commented 10 months ago

It started working fine when I did the "go get github.com/coredns/alternate" before "go get github.com/cloud66-oss/coredns_mysql".

mayurgorani commented 10 months ago

Getting the same error, I don't have any plugin to add before it or after it

image
SuperQ commented 10 months ago

https://github.com/coredns/alternate#building-coredns-with-alternate

$ git diff plugin.cfg
diff --git a/plugin.cfg b/plugin.cfg
index 407a668e..62c41142 100644
--- a/plugin.cfg
+++ b/plugin.cfg
@@ -64,6 +64,7 @@ auto:auto
 secondary:secondary
 etcd:etcd
 loop:loop
+alternate:github.com/coredns/alternate
 forward:forward
 grpc:grpc
 erratic:erratic
mayurgorani commented 10 months ago

@SuperQ , yes I've added alternate before forward only

SuperQ commented 10 months ago

I have cut v0.2.0 with updated Go module dependencies. Please try go generate again. Also make sure your source for CoreDNS is up to date with v1.11.1.