Skip to content

Commit 2c52d46

Browse files
liveaverageclaude
andcommitted
Fix isPlatformSupported to reject unknown GPU platforms
The function was accepting any platform containing "gpu" in the name, including invalid platforms like "random-gpu". Now it only accepts platforms with known GPU model names (h100, h200, l40s, a100, etc). Changes: - Remove generic "gpu" from indicators list - Rename to knownGPUTypes for clarity - Only accept platforms containing specific GPU model names - Platforms like "gpu-h100-sxm" and "h100-sxm" still work (both contain "h100") - "random-gpu" now correctly returns false Fixes test: TestIsPlatformSupported/Random_name_with_gpu 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2921f5e commit 2c52d46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

v1/providers/nebius/instancetype.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ func (c *NebiusClient) getGPUQuotaName(platformName string) string {
340340
func (c *NebiusClient) isPlatformSupported(platformName string) bool {
341341
platformLower := strings.ToLower(platformName)
342342

343-
// For GPU platforms: accept any GPU platform (filtered by quota availability)
344-
// Look for common GPU indicators in platform names
345-
gpuIndicators := []string{"gpu", "h100", "h200", "l40s", "a100", "v100", "a10", "t4", "l4", "b200"}
346-
for _, indicator := range gpuIndicators {
347-
if strings.Contains(platformLower, indicator) {
343+
// For GPU platforms: only accept known GPU types
344+
// Check for specific GPU model names (with or without "gpu-" prefix)
345+
knownGPUTypes := []string{"h100", "h200", "l40s", "a100", "v100", "a10", "t4", "l4", "b200"}
346+
for _, gpuType := range knownGPUTypes {
347+
if strings.Contains(platformLower, gpuType) {
348348
return true
349349
}
350350
}

0 commit comments

Comments
 (0)