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>
This commit is contained in:
parent
f4cb9a1ba3
commit
bb7ee5010e
2 changed files with 31 additions and 13 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue