aboutsummaryrefslogtreecommitdiff
path: root/middleware/kubernetes
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-11-07 19:15:21 +0000
committerGravatar GitHub <noreply@github.com> 2016-11-07 19:15:21 +0000
commitfb7fcff982dc4f93d571eb993e4aa5f20620e101 (patch)
treed588b7d82e3b510aa8ef53d7b58c45fc3695a4e2 /middleware/kubernetes
parente89c4b5c2863cdc889ac756185a15d1e959ddcdc (diff)
downloadcoredns-fb7fcff982dc4f93d571eb993e4aa5f20620e101.tar.gz
coredns-fb7fcff982dc4f93d571eb993e4aa5f20620e101.tar.zst
coredns-fb7fcff982dc4f93d571eb993e4aa5f20620e101.zip
middleware/file|auto: Notifies and AXFR (#399)
Be more explicit in the logs when a notify fails. New notify error message looks like: 2016/11/07 18:21:42 [ERROR] Notify for zone "example.org." was not accepted by "8.8.8.8:53": rcode was "SERVFAIL" Correctly pick up secondaries When multiple secondary are specified make sure they are picked up. Fixes #393 #398
Diffstat (limited to 'middleware/kubernetes')
-rw-r--r--middleware/kubernetes/controller.go38
1 files changed, 19 insertions, 19 deletions
diff --git a/middleware/kubernetes/controller.go b/middleware/kubernetes/controller.go
index edf97c31b..e387b17fd 100644
--- a/middleware/kubernetes/controller.go
+++ b/middleware/kubernetes/controller.go
@@ -97,28 +97,28 @@ func serviceListFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) fun
}
}
-func v1ToApiFilter(in watch.Event) (out watch.Event, keep bool) {
+func v1ToAPIFilter(in watch.Event) (out watch.Event, keep bool) {
if in.Type == watch.Error {
return in, true
}
switch v1Obj := in.Object.(type) {
- case *v1.Service:
- var apiObj api.Service
- err := v1.Convert_v1_Service_To_api_Service(v1Obj, &apiObj, nil)
- if err != nil {
- log.Printf("[ERROR] Could not convert v1.Service: %s", err)
- return in, true
- }
- return watch.Event{Type: in.Type, Object: &apiObj}, true
- case *v1.Namespace:
- var apiObj api.Namespace
- err := v1.Convert_v1_Namespace_To_api_Namespace(v1Obj, &apiObj, nil)
- if err != nil {
- log.Printf("[ERROR] Could not convert v1.Namespace: %s", err)
- return in, true
- }
- return watch.Event{Type: in.Type, Object: &apiObj}, true
+ case *v1.Service:
+ var apiObj api.Service
+ err := v1.Convert_v1_Service_To_api_Service(v1Obj, &apiObj, nil)
+ if err != nil {
+ log.Printf("[ERROR] Could not convert v1.Service: %s", err)
+ return in, true
+ }
+ return watch.Event{Type: in.Type, Object: &apiObj}, true
+ case *v1.Namespace:
+ var apiObj api.Namespace
+ err := v1.Convert_v1_Namespace_To_api_Namespace(v1Obj, &apiObj, nil)
+ if err != nil {
+ log.Printf("[ERROR] Could not convert v1.Namespace: %s", err)
+ return in, true
+ }
+ return watch.Event{Type: in.Type, Object: &apiObj}, true
}
log.Printf("[WARN] Unhandled v1 type in event: %v", in)
@@ -134,7 +134,7 @@ func serviceWatchFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) fu
if err != nil {
return nil, err
}
- return watch.Filter(w, v1ToApiFilter), nil
+ return watch.Filter(w, v1ToAPIFilter), nil
}
}
@@ -165,7 +165,7 @@ func namespaceWatchFunc(c *kubernetes.Clientset, s *labels.Selector) func(option
if err != nil {
return nil, err
}
- return watch.Filter(w, v1ToApiFilter), nil
+ return watch.Filter(w, v1ToAPIFilter), nil
}
}