diff options
author | 2020-05-14 15:39:40 -0400 | |
---|---|---|
committer | 2020-05-14 12:39:40 -0700 | |
commit | bb7ee5010ed7eeba7aa269bdbe73b31e620c17cb (patch) | |
tree | b9b45a8c228d059b15f570f0770920d9629fabbe /plugin/kubernetes/object/endpoint.go | |
parent | f4cb9a1ba3e3ef51873b7e6283948aef0256a29f (diff) | |
download | coredns-bb7ee5010ed7eeba7aa269bdbe73b31e620c17cb.tar.gz coredns-bb7ee5010ed7eeba7aa269bdbe73b31e620c17cb.tar.zst coredns-bb7ee5010ed7eeba7aa269bdbe73b31e620c17cb.zip |
plugin/kubernetes: Handle endpoint tombstones (#3887)
* check for nil
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* handle tombstone
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* move casting to caller. add comments.
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* more sanding
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* more scrubbing
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* move object unwraping to switch cases
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* oops remove debug
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* remove cruft
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/kubernetes/object/endpoint.go')
-rw-r--r-- | plugin/kubernetes/object/endpoint.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/plugin/kubernetes/object/endpoint.go b/plugin/kubernetes/object/endpoint.go index c7d6b7323..2a7d69acf 100644 --- a/plugin/kubernetes/object/endpoint.go +++ b/plugin/kubernetes/object/endpoint.go @@ -44,12 +44,7 @@ type EndpointPort struct { func EndpointsKey(name, namespace string) string { return name + "." + namespace } // ToEndpoints converts an api.Endpoints to a *Endpoints. -func ToEndpoints(obj interface{}) (*api.Endpoints, *Endpoints) { - end, ok := obj.(*api.Endpoints) - if !ok { - return nil, nil - } - +func ToEndpoints(end *api.Endpoints) *Endpoints { e := &Endpoints{ Version: end.GetResourceVersion(), Name: end.GetName(), @@ -93,7 +88,7 @@ func ToEndpoints(obj interface{}) (*api.Endpoints, *Endpoints) { } } - return end, e + return e } // CopyWithoutSubsets copies e, without the subsets. |