Skip to content

Commit ae737c8

Browse files
committed
address PR comments and keep things similar to upstream
Signed-off-by: Swati Gupta <[email protected]>
1 parent 2a2d340 commit ae737c8

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

cmd/compute-domain-kubelet-plugin/driver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func (d *driver) Shutdown() error {
139139
if d == nil {
140140
return nil
141141
}
142+
142143
if err := d.state.computeDomainManager.Stop(); err != nil {
143144
return fmt.Errorf("error stopping ComputeDomainManager: %w", err)
144145
}

cmd/compute-domain-kubelet-plugin/health.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright 2025 The Kubernetes Authors.
23
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -61,7 +62,7 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
6162
Scheme: "unix",
6263
// TODO: this needs to adapt when seamless upgrades
6364
// are enabled and the filename includes a uid.
64-
Path: path.Join(DriverRegistrarPath, DriverName+"-reg.sock"),
65+
Path: path.Join(config.flags.kubeletRegistrarDirectoryPath, DriverName+"-reg.sock"),
6566
}).String()
6667
klog.V(6).Infof("connecting to registration socket path=%s", regSockPath)
6768
regConn, err := grpc.NewClient(
@@ -74,7 +75,7 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
7475

7576
draSockPath := (&url.URL{
7677
Scheme: "unix",
77-
Path: path.Join(DriverPluginPath, "dra.sock"),
78+
Path: path.Join(config.DriverPluginPath(), "dra.sock"),
7879
}).String()
7980
klog.V(6).Infof("connecting to DRA socket path=%s", draSockPath)
8081
draConn, err := grpc.NewClient(
@@ -106,8 +107,8 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
106107
}
107108

108109
func (h *healthcheck) Stop() {
109-
klog.Info("Stopping healthcheck service")
110110
if h.server != nil {
111+
klog.Info("Stopping healthcheck service")
111112
h.server.GracefulStop()
112113
}
113114
h.wg.Wait()

cmd/compute-domain-kubelet-plugin/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
const (
3737
DriverName = "compute-domain.nvidia.com"
3838
DriverPluginCheckpointFileBasename = "checkpoint.json"
39-
DriverRegistrarPath = "/var/lib/kubelet/plugins_registry"
4039
)
4140

4241
type Flags struct {

cmd/gpu-kubelet-plugin/driver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func (d *driver) Shutdown() error {
104104
if d == nil {
105105
return nil
106106
}
107+
107108
if d.healthcheck != nil {
108109
d.healthcheck.Stop()
109110
}

cmd/gpu-kubelet-plugin/health.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright 2025 The Kubernetes Authors.
23
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -61,7 +62,7 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
6162
Scheme: "unix",
6263
// TODO: this needs to adapt when seamless upgrades
6364
// are enabled and the filename includes a uid.
64-
Path: path.Join(DriverRegistrarPath, DriverName+"-reg.sock"),
65+
Path: path.Join(config.flags.kubeletRegistrarDirectoryPath, DriverName+"-reg.sock"),
6566
}).String()
6667
klog.V(6).Infof("connecting to registration socket path=%s", regSockPath)
6768
regConn, err := grpc.NewClient(
@@ -74,7 +75,7 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
7475

7576
draSockPath := (&url.URL{
7677
Scheme: "unix",
77-
Path: path.Join(DriverPluginPath, "dra.sock"),
78+
Path: path.Join(config.DriverPluginPath(), "dra.sock"),
7879
}).String()
7980
klog.V(6).Infof("connecting to DRA socket path=%s", draSockPath)
8081
draConn, err := grpc.NewClient(
@@ -106,8 +107,8 @@ func startHealthcheck(ctx context.Context, config *Config) (*healthcheck, error)
106107
}
107108

108109
func (h *healthcheck) Stop() {
109-
klog.Info("Stopping healthcheck service")
110110
if h.server != nil {
111+
klog.Info("Stopping healthcheck service")
111112
h.server.GracefulStop()
112113
}
113114
h.wg.Wait()

cmd/gpu-kubelet-plugin/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
const (
3737
DriverName = "gpu.nvidia.com"
3838
DriverPluginCheckpointFileBasename = "checkpoint.json"
39-
DriverRegistrarPath = "/var/lib/kubelet/plugins_registry"
4039
)
4140

4241
type Flags struct {

deployments/helm/nvidia-dra-driver-gpu/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ kubeletPlugin:
154154
resources: {}
155155
# Port running a gRPC health service checked by a livenessProbe.
156156
# Set to a negative value to disable the service and the probe.
157-
healthcheckPort: 61619
157+
healthcheckPort: 51515
158158
gpus:
159159
securityContext:
160160
privileged: true
161161
resources: {}
162162
# Port running a gRPC health service checked by a livenessProbe.
163163
# Set to a negative value to disable the service and the probe.
164-
healthcheckPort: 51518
164+
healthcheckPort: 51516
165165
affinity:
166166
nodeAffinity:
167167
requiredDuringSchedulingIgnoredDuringExecution:

0 commit comments

Comments
 (0)