-
Notifications
You must be signed in to change notification settings - Fork 7
/
client.go
30 lines (24 loc) · 865 Bytes
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ingress
import (
"fmt"
"k8s.io/client-go/kubernetes"
"github.com/flomesh-io/fsm/pkg/certificate"
"github.com/flomesh-io/fsm/pkg/configurator"
"github.com/flomesh-io/fsm/pkg/k8s"
"github.com/flomesh-io/fsm/pkg/messaging"
)
// Initialize initializes the client and starts the ingress gateway certificate manager routine
func Initialize(kubeClient kubernetes.Interface, kubeController k8s.Controller, stop chan struct{},
cfg configurator.Configurator, certProvider *certificate.Manager, msgBroker *messaging.Broker) error {
c := &client{
kubeClient: kubeClient,
kubeController: kubeController,
cfg: cfg,
certProvider: certProvider,
msgBroker: msgBroker,
}
if err := c.provisionIngressGatewayCert(stop); err != nil {
return fmt.Errorf("Error provisioning ingress gateway certificate: %w", err)
}
return nil
}