acoustic-carpenter-78188
03/18/2026, 6:03 PMGpuResourceName from the K8s plugin config instead of hardcoding "<http://nvidia.com/gpu|nvidia.com/gpu>" in convertTaskResourcesToRequirements()
Problem
convertTaskResourcesToRequirements() in taskexec_context.go uses the hardcoded constant utils.ResourceNvidiaGPU ("<http://nvidia.com/gpu|nvidia.com/gpu>") for GPU resource requests and limits. The K8s plugin config already provides a configurable GpuResourceName field (via gpu-resource-name in the config), but this function ignores it.
This means operators using alternative GPU resource types (e.g. "<http://amd.com/gpu|amd.com/gpu>", "<http://nvidia.com/gpu.shared|nvidia.com/gpu.shared>", "<http://habana.ai/gaudi|habana.ai/gaudi>") cannot use the existing configuration to change the GPU resource name — it's always hardcoded to <http://nvidia.com/gpu|nvidia.com/gpu>.
The config field is already used correctly in flyteplugins/go/tasks/pluginmachinery/flytek8s/ (e.g. container_helper.go), but flytepropeller bypasses it.
Fix
Replace utils.ResourceNvidiaGPU with k8sConfig.GetK8sPluginConfig().GpuResourceName in convertTaskResourcesToRequirements(). This reads the configured GPU resource name at runtime, defaulting to "<http://nvidia.com/gpu|nvidia.com/gpu>" when not explicitly set.
Testing
• Default behavior unchanged: GpuResourceName defaults to "<http://nvidia.com/gpu|nvidia.com/gpu>"
• Custom GPU resource names (e.g. "<http://amd.com/gpu|amd.com/gpu>") are now respected in task resource requirements
Closes #6746
flyteorg/flyte