(s *store.ClusterStore, config *config.ControllerConfig)
| 54 | } |
| 55 | |
| 56 | func New(s *store.ClusterStore, config *config.ControllerConfig) (*Controller, error) { |
| 57 | c := &Controller{ |
| 58 | config: config, |
| 59 | clusterStore: s, |
| 60 | clusters: make(map[string]*ClusterChecker), |
| 61 | readyCh: make(chan struct{}, 1), |
| 62 | closeCh: make(chan struct{}), |
| 63 | } |
| 64 | c.state.Store(stateInit) |
| 65 | return c, nil |
| 66 | } |
| 67 | |
| 68 | func (c *Controller) Start(ctx context.Context) error { |
| 69 | if !c.state.CompareAndSwap(stateInit, stateRunning) { |
no outgoing calls