Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin/kubernetes: fix tombstone unwrapping #3924

Merged
merged 6 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use meta.Object instead of interface{}
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
  • Loading branch information
chrisohaver committed Jun 4, 2020
commit 8aabd9c143487a0078d433f513453b31c22ed9a4
2 changes: 1 addition & 1 deletion plugin/kubernetes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func newdnsController(ctx context.Context, kubeClient kubernetes.Interface, opts
return &dns
}

func (dns *dnsControl) recordDNSProgrammingLatency(obj interface{}) {
func (dns *dnsControl) recordDNSProgrammingLatency(obj meta.Object) {
recordDNSProgrammingLatency(dns.getServices(obj.(*api.Endpoints)), obj.(*api.Endpoints))
}

Expand Down
7 changes: 4 additions & 3 deletions plugin/kubernetes/object/informer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package object

import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/cache"
)
Expand All @@ -20,7 +21,7 @@ func NewIndexerInformer(lw cache.ListerWatcher, objType runtime.Object, h cache.
return clientState, cache.New(cfg)
}

type recordLatencyFunc func(interface{})
type recordLatencyFunc func(meta.Object)

// DefaultProcessor is based on the Process function from cache.NewIndexerInformer except it does a conversion.
func DefaultProcessor(convert ToFunc, recordLatency recordLatencyFunc) ProcessorBuilder {
Expand All @@ -45,7 +46,7 @@ func DefaultProcessor(convert ToFunc, recordLatency recordLatencyFunc) Processor
h.OnAdd(obj)
}
if recordLatency != nil {
recordLatency(d.Object)
recordLatency(d.Object.(meta.Object))
}
case cache.Deleted:
var obj interface{}
Expand All @@ -63,7 +64,7 @@ func DefaultProcessor(convert ToFunc, recordLatency recordLatencyFunc) Processor
}
h.OnDelete(obj)
if !ok && recordLatency != nil {
recordLatency(d.Object)
recordLatency(d.Object.(meta.Object))
}
}
}
Expand Down