-
Notifications
You must be signed in to change notification settings - Fork 7
/
handlers.go
21 lines (16 loc) · 951 Bytes
/
handlers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package watcher
import "github.com/Demonware/balanced/pkg/apis/balanced/v1alpha1"
type PostSyncHandler func() error
type ControllerHandlers struct {
// handlers that would be called during controller start up; during service manager population
// WARNING: do not rely on serviceManager.List() or .Get() operations during service manager population
// as it will not contain the full set of Kubernetes Services and Endpoints
InitServiceOnChangeHandlers []v1alpha1.ServiceOnChangeHandler
InitEndpointsOnChangeHandlers []v1alpha1.EndpointOnChangeHandler
// handlers that would be called during actual Kubernetes service/endpoints changes
// it is safe to rely on serviceManager.List() or .Get() operations at this point
ServiceOnChangeHandlers []v1alpha1.ServiceOnChangeHandler
EndpointsOnChangeHandlers []v1alpha1.EndpointOnChangeHandler
// handlers to be done post sync (eg. garbage collection)
PostSyncHandlers []PostSyncHandler
}