Skip to content

Commit

Permalink
Merge pull request #1034 from ArangoGutierrez/issue-1032
Browse files Browse the repository at this point in the history
nfd-master: always start gRPC server
  • Loading branch information
k8s-ci-robot authored Jan 16, 2023
2 parents 497e6c7 + 9b3171b commit 2068fcd
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 2068fcd

Please sign in to comment.