MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / initCluster

Method initCluster

pkg/component/cluster.go:27–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25)
26
27func (c *Component) initCluster() (err error) {
28 clusterOpts := []cluster.Option{
29 cluster.WithConn(c.LoopbackConn()),
30 cluster.WithDialOptions(rpcclient.DefaultDialOptions),
31 }
32 for _, svc := range c.grpcSubsystems {
33 clusterOpts = append(clusterOpts, cluster.WithServices(svc))
34 }
35 if tlsConfig, err := c.GetTLSClientConfig(c.Context()); err == nil {
36 clusterOpts = append(clusterOpts, cluster.WithTLSConfig(tlsConfig))
37 }
38 ctx := log.NewContextWithField(c.ctx, "namespace", "cluster")
39 c.cluster, err = c.clusterNew(ctx, &c.config.ServiceBase.Cluster, clusterOpts...)
40 if err != nil {
41 return err
42 }
43 return nil
44}
45
46// ClusterTLS returns whether the cluster uses TLS for cluster connections.
47func (c *Component) ClusterTLS() bool {

Callers 1

StartMethod · 0.95

Implementers 1

Componentpkg/component/component.go

Calls 8

LoopbackConnMethod · 0.95
GetTLSClientConfigMethod · 0.95
ContextMethod · 0.95
WithConnFunction · 0.92
WithDialOptionsFunction · 0.92
WithServicesFunction · 0.92
WithTLSConfigFunction · 0.92
NewContextWithFieldFunction · 0.92

Tested by

no test coverage detected