Skip to content

fix: fail the node pool when its additional driver configs do not render - #3044

Open
v0ropaev wants to merge 1 commit into
NVIDIA:mainfrom
v0ropaev:fix/driver-additional-configs-error
Open

v0ropaev wants to merge 1 commit into
NVIDIA:mainfrom
v0ropaev:fix/driver-additional-configs-error

Conversation

@v0ropaev

Copy link
Copy Markdown

Description

stateDriver.getManifestObjects logs the error from getDriverAdditionalConfigs and carries on (internal/state/driver.go:333):

		renderData.AdditionalConfigs, err = s.getDriverAdditionalConfigs(ctx, cr, clusterInfo, nodePool)
		if err != nil {
			logger.Error(err, "error rendering addition driver volume", "NodePool", nodePool.name)
		}

Every other fallible step in the same loop returns instead: getDriverSpec, getGDSSpec, getGDRCopySpec, renderManifestObjects, handleDefaultImagesInObjects.

Two things follow from carrying on. The call assigns into renderData.AdditionalConfigs, so the failure leaves that field nil, and manifests/state-driver/0500_daemonset.yaml guards every use of it with {{- if and .AdditionalConfigs .AdditionalConfigs.VolumeMounts }} and .AdditionalConfigs.Volumes. The driver therefore renders with none of the volumes the user configured: no custom package repository, no custom CA certificates, no kernel module parameters, no vGPU licensing config. And getDriverAdditionalConfigs only ever returns nil alongside its error, so nothing partial is being salvaged.

What a user sees: they set spec.repoConfig.name (or certConfig, kernelModuleConfig, a vGPU licensingConfig) on an NVIDIADriver, the ConfigMap is missing or misnamed or the node's distro is not in RepoConfigPathMap, and the reconcile reports success. The NVIDIADriver goes Ready once the pods come up, and the driver runs against the default repository. The only trace is one log line; nothing reaches the CR status or its conditions. A driver built against the wrong package repository is not a milder failure than a reconcile error, it is a harder one to find.

The ClusterPolicy path for the same inputs does not behave this way. transformDriverContainer in controllers/object_controls.go returns fmt.Errorf("ERROR: failed to create ConfigMap VolumeMounts for custom repo config: %v", err) to its caller.

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

make lint fails here, with three staticcheck SA4023 findings around resolveHostNvidiaSMI in cmd/nvidia-validator/main.go. It fails the same way on an untouched tree and has nothing to do with this change, so I left it alone.

Testing

TestGetManifestObjectsAdditionalConfigsErrorIsLogged pinned the old behaviour, with a comment reading "The driver is still deployed, silently without the repo config the user asked for". It arrived in #2658, which added unit tests across internal/state, so it recorded what the code does rather than what it should do. I renamed it to TestGetManifestObjectsAdditionalConfigsError and flipped the assertions, which keeps the same fixture: one GPU node, an NVIDIADriver whose spec.repoConfig.name points at a ConfigMap that is not in the fake client.

With only the test change applied and driver.go untouched:

--- FAIL: TestGetManifestObjectsAdditionalConfigsError (0.09s)
    driver_manifest_test.go:538:
        	Error:      	An error is expected but got nil.

and with the fix, go test ./internal/state/ is ok. go build ./..., go vet ./internal/state/ and gofmt -l are clean, and go test ./... passes everywhere except tests/e2e, which needs a cluster and fails identically on an untouched tree.

No GPU or cluster was used. The whole path is covered by the fake client.

getManifestObjects logs the error from getDriverAdditionalConfigs and carries
on. Every other fallible step in the same loop returns it: getDriverSpec,
getGDSSpec, getGDRCopySpec, renderManifestObjects and
handleDefaultImagesInObjects. Because the call assigns into
renderData.AdditionalConfigs, the failure also leaves that field nil, and the
DaemonSet template guards every use of it with

  {{- if and .AdditionalConfigs .AdditionalConfigs.VolumeMounts }}

so the driver renders with none of the volumes the user asked for: no custom
package repo, no custom CA certificates, no kernel module parameters and no
vGPU licensing config. getDriverAdditionalConfigs only ever returns nil with
the error, so there is no partial result worth keeping.

The reconcile reports success, the NVIDIADriver goes Ready once the pods come
up, and the only trace is one log line. Nothing reaches the CR status or its
conditions. The ClusterPolicy path does not behave this way:
transformDriverContainer returns the same failure to its caller.

TestGetManifestObjectsAdditionalConfigsErrorIsLogged pinned the old behaviour,
down to a comment saying the driver is still deployed "silently without the
repo config the user asked for". It came in with NVIDIA#2658, which added unit tests
across internal/state, so it recorded what the code did rather than what it
should do. Renamed and flipped to assert the error.

Signed-off-by: Dmitry Voropaev <dy.voropaev@gmail.com>
@v0ropaev
v0ropaev requested a review from a team as a code owner October 10, 2026 22:39
@copy-pr-bot

copy-pr-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/gpu-operator/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Enterprise
  • Run ID: 91ef4a21-0b2e-419f-8d01-ab960c02bff1

📥 Commits

Reviewing files that changed from the base of the PR and between 9eddbaa and 13acf3e.


📒 Files selected for processing (2)
  • internal/state/driver.go
  • internal/state/driver_manifest_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.



📝 Walkthrough

Walkthrough

When additional-config construction fails for a node pool, getManifestObjects now returns an error that identifies the pool instead of logging the error and continuing. The updated test expects the missing repo-config name in the error and verifies that no objects are returned. Unused logging imports were removed.


Priority: ➖ Normal

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 13acf

Missing driver configuration now fails reconciliation instead of allowing incomplete manifests to be applied. The inspected caller stops before applying objects, and no actionable merge risk remains.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@kvalliyurnatt kvalliyurnatt self-assigned this Oct 13, 2026
@kvalliyurnatt

Copy link
Copy Markdown
Contributor

/ok to test 13acf3e

@kvalliyurnatt kvalliyurnatt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thanks for the fix @v0ropaev

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants