aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/metrics_test.go
diff options
context:
space:
mode:
authorGravatar ZouYu <zouy.fnst@cn.fujitsu.com> 2020-10-28 14:39:56 +0800
committerGravatar GitHub <noreply@github.com> 2020-10-28 07:39:56 +0100
commitc58e4b09fcc07157595a3fc1db7649a4033c3258 (patch)
treefd4e113ef617e01be726130d06f94707ed68777f /plugin/kubernetes/metrics_test.go
parentd6660f369ebb67c861ae9ab0fe9429c513f8278f (diff)
downloadcoredns-c58e4b09fcc07157595a3fc1db7649a4033c3258.tar.gz
coredns-c58e4b09fcc07157595a3fc1db7649a4033c3258.tar.zst
coredns-c58e4b09fcc07157595a3fc1db7649a4033c3258.zip
Fix golint warnings (#4241)
Include: 1. plugin/forward/type.go:8:2: const typeUdp should be typeUDP 2. plugin/forward/type.go:9:2: const typeTcp should be typeTCP 3. plugin/forward/type.go:10:2: const typeTls should be typeTLS 4. plugin/kubernetes/metrics.go:24:2: var DnsProgrammingLatency should be DNSProgrammingLatency 5. plugin/kubernetes/metrics_test.go:124:102: func parameter clusterIp should be clusterIP Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
Diffstat (limited to '')
-rw-r--r--plugin/kubernetes/metrics_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugin/kubernetes/metrics_test.go b/plugin/kubernetes/metrics_test.go
index e1be40d4e..0ab6f3c20 100644
--- a/plugin/kubernetes/metrics_test.go
+++ b/plugin/kubernetes/metrics_test.go
@@ -20,7 +20,7 @@ const (
namespace = "testns"
)
-func TestDnsProgrammingLatency(t *testing.T) {
+func TestDNSProgrammingLatency(t *testing.T) {
client := fake.NewSimpleClientset()
now := time.Now()
ctx := context.TODO()
@@ -32,7 +32,7 @@ func TestDnsProgrammingLatency(t *testing.T) {
durationSinceFunc = func(t time.Time) time.Duration {
return now.Sub(t)
}
- DnsProgrammingLatency.Reset()
+ DNSProgrammingLatency.Reset()
go controller.Run()
subset1 := []api.EndpointSubset{{
@@ -86,7 +86,7 @@ func TestDnsProgrammingLatency(t *testing.T) {
coredns_kubernetes_dns_programming_duration_seconds_sum{service_kind="headless_with_selector"} 3
coredns_kubernetes_dns_programming_duration_seconds_count{service_kind="headless_with_selector"} 2
`
- if err := testutil.CollectAndCompare(DnsProgrammingLatency, strings.NewReader(expected)); err != nil {
+ if err := testutil.CollectAndCompare(DNSProgrammingLatency, strings.NewReader(expected)); err != nil {
t.Error(err)
}
}
@@ -121,11 +121,11 @@ func updateEndpoints(t *testing.T, client kubernetes.Interface, name string, tri
}
}
-func createService(t *testing.T, client kubernetes.Interface, controller dnsController, name string, clusterIp string) {
+func createService(t *testing.T, client kubernetes.Interface, controller dnsController, name string, clusterIP string) {
ctx := context.TODO()
if _, err := client.CoreV1().Services(namespace).Create(ctx, &api.Service{
ObjectMeta: meta.ObjectMeta{Namespace: namespace, Name: name},
- Spec: api.ServiceSpec{ClusterIP: clusterIp},
+ Spec: api.ServiceSpec{ClusterIP: clusterIP},
}, meta.CreateOptions{}); err != nil {
t.Fatal(err)
}