1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-17 13:58:21 +00:00

Merge pull request #1037 from k8s-infra-cherrypick-robot/cherry-pick-1034-to-release-0.12

[release-0.12] nfd-master: always start gRPC server
This commit is contained in:
Kubernetes Prow Robot 2023-01-16 22:20:33 -08:00 committed by GitHub
commit 3612b61b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,9 +175,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 {
@ -229,7 +227,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)