fix notifications
This commit is contained in:
1 parent
e790c02d59
commit
a0f558b43c
10 files changed
+277
-7
No files matched your search
@@ -24,9 +24,10 @@ import (
|
||||
// Registry serves the latest Snapshot. A nil *Registry resolves nothing, so
|
||||
// callers need no cluster to run.
|
||||
type Registry struct {
|
||||
snap atomic.Pointer[Snapshot]
|
||||
dirty atomic.Bool
|
||||
built atomic.Int64 // unix seconds of the last rebuild
|
||||
snap atomic.Pointer[Snapshot]
|
||||
dirty atomic.Bool
|
||||
built atomic.Int64 // unix seconds of the last rebuild
|
||||
client kubernetes.Interface // for on-demand pod lookups; nil outside a cluster
|
||||
}
|
||||
|
||||
// Resolve returns the backends serving host+path.
|
||||
@@ -79,7 +80,7 @@ func NewFromEnv(ctx context.Context) (*Registry, error) {
|
||||
svc := factory.Core().V1().Services().Informer()
|
||||
dep := factory.Apps().V1().Deployments().Informer()
|
||||
|
||||
r := &Registry{}
|
||||
r := &Registry{client: client}
|
||||
mark := cache.ResourceEventHandlerFuncs{
|
||||
AddFunc: func(any) { r.dirty.Store(true) },
|
||||
UpdateFunc: func(_, _ any) { r.dirty.Store(true) },
|
||||
|
||||
Reference in new issue
Block a user