Repository navigation
Conversation
Generate deterministic DNS-label volume names while preserving original ConfigMap references and existing valid volume names. Use the same names for driver and device-plugin volume mounts. Signed-off-by: Jiale Su <122144270+shenyv1@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
|
@shenyv1 thanks for your contribution ! While reviewing the PR I was wondering that it will be simpler if we just made the volume name static, I feel that will simplify the code substantially It will change the Pod template for the existing Pods as well, but I feel that might be okay. wdyt ? |
Use role-specific fixed names for ConfigMap volumes while preserving the referenced ConfigMap names. Update shared mounts and regression tests, and remove the ConfigMap volume-name hashing helper. Signed-off-by: Leo_Su <122144270+shenyv1@users.noreply.github.com>
|
@kvalliyurnatt Thanks for the suggestion! I think you're right — fixed volume names make this much simpler. I've updated the PR accordingly. |
Issue
Fixes #3204
Description
ConfigMap names may contain dots and exceed 63 characters, while Pod volume names must be DNS labels of at most 63 characters. The driver configuration helpers currently use the ConfigMap name directly for both volumes and mounts, so valid ConfigMap names such as
driver.configproduce invalid DaemonSet Pod templates.Add
ConfigMapVolumeNameand use it forrepoConfig,certConfig, andkernelModuleConfigvolumes and mounts in both the ClusterPolicy and NVIDIADriver paths:configMap.namepointing to the original ConfigMap; mounted files and paths are unchanged.The device-plugin configuration path also uses the shared
createConfigMapVolumehelper but constructs its mounts separately. UpdateaddSharedMountsForPluginConfigto use the same naming helper so its mounts continue to match the volume.Add regression tests for naming boundaries, both driver configuration paths (including NVIDIADriver template rendering), and device-plugin volume/mount matching.
A generated name can still match another ConfigMap's preserved valid name. Resolving conflicts across all volumes in a Pod is outside the scope of this fix.
Checklist
make lint)make validate-generated-assets)make validate-modules)Testing
Using Go 1.27.4 and golangci-lint 2.14.0:
make fmt unit-test: passed.make check: passed, including lint, license, module, and generated-asset checks. No generated or dependency changes.No live Kubernetes/GPU cluster or end-to-end testing.