Skip to content

Commit

Permalink
Skip register of gRPC LabelerServer when using -enable-nodefeature-api
Browse files Browse the repository at this point in the history
Don't register gRPC LabelServer when using the NodeFeature option, only
turn the gRPC server on for Health and Readiness probes
  • Loading branch information
ArangoGutierrez committed Jan 16, 2023
1 parent 497e6c7 commit f93a774
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/nfd-master/nfd-master.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ func (m *nfdMaster) Run() error {

// Run gRPC server
grpcErr := make(chan error, 1)
if !m.args.EnableNodeFeatureApi {
go m.runGrpcServer(grpcErr)
}
go m.runGrpcServer(grpcErr)

// Run updater that handles events from the nfd CRD API.
if m.nfdController != nil {
Expand Down Expand Up @@ -228,7 +226,13 @@ func (m *nfdMaster) runGrpcServer(errChan chan<- error) {
serverOpts = append(serverOpts, grpc.Creds(credentials.NewTLS(tlsConfig)))
}
m.server = grpc.NewServer(serverOpts...)
pb.RegisterLabelerServer(m.server, m)

// If the NodeFeature API is enabled, don'tregister the labeler API
// server. Otherwise, register the labeler server.
if !m.args.EnableNodeFeatureApi {
pb.RegisterLabelerServer(m.server, m)
}

grpc_health_v1.RegisterHealthServer(m.server, health.NewServer())
klog.Infof("gRPC server serving on port: %d", m.args.Port)

Expand Down

0 comments on commit f93a774

Please sign in to comment.