aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2020-01-30 09:19:26 +0000
committerGravatar GitHub <noreply@github.com> 2020-01-30 09:19:26 +0000
commit995179a6c6f3eccbc04b20ff4961653d06c63551 (patch)
tree0782daf1752f3aecb590232b14908eff119064e6 /plugin
parent488464b68668310cbdeb67ada3ff33dd13138f0b (diff)
downloadcoredns-995179a6c6f3eccbc04b20ff4961653d06c63551.tar.gz
coredns-995179a6c6f3eccbc04b20ff4961653d06c63551.tar.zst
coredns-995179a6c6f3eccbc04b20ff4961653d06c63551.zip
presubmit: check import path ordering (#3636)
Add a test for this as well as it's annoying to point out in every code review. Fix all the import paths that are flagged by this new test. Fixes: #3634 Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/cache/prefech_test.go2
-rw-r--r--plugin/dnssec/dnskey.go2
-rw-r--r--plugin/etcd/etcd.go2
-rw-r--r--plugin/kubernetes/ns_test.go2
-rw-r--r--plugin/kubernetes/setup.go15
-rw-r--r--plugin/pkg/upstream/upstream.go4
-rw-r--r--plugin/test/scrape.go3
-rw-r--r--plugin/trace/trace.go8
8 files changed, 14 insertions, 24 deletions
diff --git a/plugin/cache/prefech_test.go b/plugin/cache/prefech_test.go
index c4673a726..609956ee9 100644
--- a/plugin/cache/prefech_test.go
+++ b/plugin/cache/prefech_test.go
@@ -8,8 +8,8 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/pkg/dnstest"
-
"github.com/coredns/coredns/plugin/test"
+
"github.com/miekg/dns"
)
diff --git a/plugin/dnssec/dnskey.go b/plugin/dnssec/dnskey.go
index 6ca89802e..11e18fdc6 100644
--- a/plugin/dnssec/dnskey.go
+++ b/plugin/dnssec/dnskey.go
@@ -9,8 +9,8 @@ import (
"time"
"github.com/coredns/coredns/request"
- "github.com/miekg/dns"
+ "github.com/miekg/dns"
"golang.org/x/crypto/ed25519"
)
diff --git a/plugin/etcd/etcd.go b/plugin/etcd/etcd.go
index 5a497d57b..3935baf0b 100644
--- a/plugin/etcd/etcd.go
+++ b/plugin/etcd/etcd.go
@@ -12,9 +12,9 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/etcd/msg"
"github.com/coredns/coredns/plugin/pkg/fall"
+ "github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/coredns/coredns/request"
- "github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/miekg/dns"
etcdcv3 "go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
diff --git a/plugin/kubernetes/ns_test.go b/plugin/kubernetes/ns_test.go
index bafe53240..19bd9b788 100644
--- a/plugin/kubernetes/ns_test.go
+++ b/plugin/kubernetes/ns_test.go
@@ -5,8 +5,8 @@ import (
"testing"
"github.com/coredns/coredns/plugin/kubernetes/object"
- "github.com/miekg/dns"
+ "github.com/miekg/dns"
api "k8s.io/api/core/v1"
)
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go
index b35d653e1..2c539bd6c 100644
--- a/plugin/kubernetes/setup.go
+++ b/plugin/kubernetes/setup.go
@@ -19,18 +19,11 @@ import (
"github.com/caddyserver/caddy"
"github.com/miekg/dns"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
-
- // Pull this in setting klog's output to stdout
- "k8s.io/klog"
-
- // Excluding azure because it is failing to compile
- // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
- _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
- // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
- _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
- // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
- _ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
+ _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
+ _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
+ _ "k8s.io/client-go/plugin/pkg/client/auth/openstack" // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s
"k8s.io/client-go/tools/clientcmd"
+ "k8s.io/klog"
)
var log = clog.NewWithPlugin("kubernetes")
diff --git a/plugin/pkg/upstream/upstream.go b/plugin/pkg/upstream/upstream.go
index c0c50d2a8..894488ffd 100644
--- a/plugin/pkg/upstream/upstream.go
+++ b/plugin/pkg/upstream/upstream.go
@@ -5,11 +5,11 @@ import (
"context"
"fmt"
- "github.com/miekg/dns"
-
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin/pkg/nonwriter"
"github.com/coredns/coredns/request"
+
+ "github.com/miekg/dns"
)
// Upstream is used to resolve CNAME or other external targets via CoreDNS itself.
diff --git a/plugin/test/scrape.go b/plugin/test/scrape.go
index 132a4f944..cb8a4cdb0 100644
--- a/plugin/test/scrape.go
+++ b/plugin/test/scrape.go
@@ -30,9 +30,8 @@ import (
"strconv"
"github.com/matttproud/golang_protobuf_extensions/pbutil"
- "github.com/prometheus/common/expfmt"
-
dto "github.com/prometheus/client_model/go"
+ "github.com/prometheus/common/expfmt"
)
type (
diff --git a/plugin/trace/trace.go b/plugin/trace/trace.go
index 5a9518695..63b2248fd 100644
--- a/plugin/trace/trace.go
+++ b/plugin/trace/trace.go
@@ -11,16 +11,14 @@ import (
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/pkg/rcode"
- "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer"
- "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
-
- // Plugin the trace package.
- _ "github.com/coredns/coredns/plugin/pkg/trace"
+ _ "github.com/coredns/coredns/plugin/pkg/trace" // Plugin the trace package.
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
ot "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin-contrib/zipkin-go-opentracing"
+ "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer"
+ "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
const (