77 "fmt"
88 "os"
99 "sync"
10- "time"
1110
1211 "go.uber.org/zap"
1312 "google.golang.org/grpc"
@@ -46,9 +45,7 @@ func newHubbleClient(cfg config.CiliumCollectorConfig, logger *zap.Logger) *hubb
4645
4746// connect establishes a gRPC connection to Hubble Relay.
4847func (h * hubbleClient ) connect (ctx context.Context ) error {
49- opts := []grpc.DialOption {
50- grpc .WithBlock (),
51- }
48+ var opts []grpc.DialOption
5249
5350 if h .cfg .HubbleTLSEnabled {
5451 tlsCfg , err := h .buildTLSConfig ()
@@ -60,10 +57,7 @@ func (h *hubbleClient) connect(ctx context.Context) error {
6057 opts = append (opts , grpc .WithTransportCredentials (insecure .NewCredentials ()))
6158 }
6259
63- dialCtx , cancel := context .WithTimeout (ctx , 10 * time .Second )
64- defer cancel ()
65-
66- conn , err := grpc .DialContext (dialCtx , h .cfg .HubbleAddress , opts ... )
60+ conn , err := grpc .NewClient (h .cfg .HubbleAddress , opts ... )
6761 if err != nil {
6862 return fmt .Errorf ("hubble dial %s: %w" , h .cfg .HubbleAddress , err )
6963 }
@@ -187,6 +181,8 @@ func (h *hubbleClient) buildTLSConfig() (*tls.Config, error) {
187181
188182// recordFlow increments the appropriate counters based on flow type.
189183// This is called from the Hubble flow observer goroutine.
184+ //
185+ //nolint:unused // Skeleton for future Hubble flow parsing implementation
190186func (h * hubbleClient ) recordFlow (isL7 bool , isDrop bool , isPolicyVerdict bool ) {
191187 h .mu .Lock ()
192188 defer h .mu .Unlock ()
@@ -205,6 +201,8 @@ func (h *hubbleClient) recordFlow(isL7 bool, isDrop bool, isPolicyVerdict bool)
205201}
206202
207203// recordDNS increments the DNS query counter.
204+ //
205+ //nolint:unused // Skeleton for future Hubble flow parsing implementation
208206func (h * hubbleClient ) recordDNS () {
209207 h .mu .Lock ()
210208 h .dnsQueries ++
0 commit comments