Skip to content

Commit bef0254

Browse files
committed
Allow IMEX daemons to start as soon as IP updated in node status
Signed-off-by: Kevin Klues <kklues@nvidia.com>
1 parent ae6283c commit bef0254

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cmd/compute-domain-daemon/computedomain.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"k8s.io/klog/v2"
2929

3030
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
31+
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/featuregates"
3132
nvinformers "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/nvidia.com/informers/externalversions"
3233
)
3334

@@ -318,13 +319,16 @@ func getNextAvailableIndex(nodes []*nvapi.ComputeDomainNode, maxNodesPerIMEXDoma
318319
return nextIndex, nil
319320
}
320321

321-
// If we've reached the expected number of nodes and if there was actually a
322-
// change compared to the previously known set of nodes: pass info to IMEX
323-
// daemon controller.
322+
// If there was actually a change compared to the previously known set of
323+
// nodes: pass info to IMEX daemon controller.
324324
func (m *ComputeDomainManager) MaybePushNodesUpdate(cd *nvapi.ComputeDomain) {
325-
if len(cd.Status.Nodes) != cd.Spec.NumNodes {
326-
klog.Infof("numNodes: %d, nodes seen: %d", cd.Spec.NumNodes, len(cd.Status.Nodes))
327-
return
325+
// When not running with the 'IMEXDaemonsWithDNSNames' feature enabled,
326+
// wait for all 'numNodes' nodes to show up before sending an update.
327+
if !featuregates.Enabled(featuregates.IMEXDaemonsWithDNSNames) {
328+
if len(cd.Status.Nodes) != cd.Spec.NumNodes {
329+
klog.Infof("numNodes: %d, nodes seen: %d", cd.Spec.NumNodes, len(cd.Status.Nodes))
330+
return
331+
}
328332
}
329333

330334
newIPs := getIPSet(cd.Status.Nodes)

0 commit comments

Comments
 (0)