NewControllerWithClient creates a Controller with a pre-built DucklingClient (for testing).
(store WarehouseStore, dc *DucklingClient, pollInterval time.Duration)
| 92 | |
| 93 | // NewController creates a provisioning controller. Returns an error if the |
| 94 | // Kubernetes client cannot be initialized (e.g., not running in-cluster). |
| 95 | func NewController(store WarehouseStore, pollInterval time.Duration) (*Controller, error) { |
| 96 | dc, err := NewDucklingClient() |
| 97 | if err != nil { |
| 98 | return nil, fmt.Errorf("create duckling client: %w", err) |
| 99 | } |
| 100 | return &Controller{ |
| 101 | store: store, |
| 102 | duckling: dc, |
| 103 | pollInterval: pollInterval, |
| 104 | probe: ProbeMetadataStore, |
no outgoing calls