Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfd-master: always start gRPC server #1034

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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