Skip to content

Commit

Permalink
Merge pull request #102 from jwcesign/fix-flannel
Browse files Browse the repository at this point in the history
fix: fix gpu node label
  • Loading branch information
jwcesign authored Nov 7, 2024
2 parents 142c8b6 + daa8fad commit e82e20f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/providers/instancetype/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func computeRequirements(info *ecsclient.DescribeInstanceTypesResponseBodyInstan
requirements.Get(v1alpha1.LabelInstanceGPUName).Insert(lowerKabobCase(*info.GPUSpec))
requirements.Get(v1alpha1.LabelInstanceGPUManufacturer).Insert(getGPUManufacturer(*info.GPUSpec))
requirements.Get(v1alpha1.LabelInstanceGPUCount).Insert(fmt.Sprint(*info.GPUAmount))
requirements.Get(v1alpha1.LabelInstanceGPUMemory).Insert(fmt.Sprint(info.GPUMemorySize))
requirements.Get(v1alpha1.LabelInstanceGPUMemory).Insert(fmt.Sprint(*info.GPUMemorySize))
}

// CPU Manufacturer, valid options: intel, amd
Expand Down Expand Up @@ -316,7 +316,9 @@ func amdGPUs(info *ecsclient.DescribeInstanceTypesResponseBodyInstanceTypesInsta
}

func lowerKabobCase(s string) string {
return strings.ToLower(strings.ReplaceAll(s, " ", "-"))
ret := strings.ReplaceAll(s, " ", "-")
ret = strings.ReplaceAll(ret, "/", "-")
return strings.ToLower(strings.ReplaceAll(ret, "*", "-"))
}

func getGPUManufacturer(gpuName string) string {
Expand Down

0 comments on commit e82e20f

Please sign in to comment.