Skip to content

Commit d6a831e

Browse files
committed
Revert "fix: bump deps, inject-container convert from limits"
This reverts commit 20a288c.
1 parent 20a288c commit d6a831e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/webhook/v1/tf_parser.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func parseAutoScalingAnnotations(pod *corev1.Pod, workloadProfile *tfv1.Workload
182182

183183
func parseGPUResourcesAnnotations(pod *corev1.Pod, workloadProfile *tfv1.WorkloadProfile) error {
184184
// extract any containers has GPU count limits and set to annotation
185-
migratedContainerLimits := []string{}
185+
isMigratedFromContainerLimits := false
186186
gpuCount, hasValue := pod.Annotations[constants.GpuCountAnnotation]
187187
if hasValue {
188188
val, err := strconv.ParseInt(gpuCount, 10, 32)
@@ -215,10 +215,8 @@ func parseGPUResourcesAnnotations(pod *corev1.Pod, workloadProfile *tfv1.Workloa
215215
if tflopsLimit, hasValue := parseResourceQuantity(pod, constants.TFLOPSLimitAnnotation); hasValue {
216216
workloadProfile.Spec.Resources.Limits.Tflops = tflopsLimit
217217
// clean compute percent limit when tflops limit is set in annotation
218-
if len(migratedContainerLimits) > 0 {
218+
if isMigratedFromContainerLimits {
219219
workloadProfile.Spec.Resources.Limits.ComputePercent = resource.Quantity{}
220-
// convert limits containers to annotation for inject container
221-
pod.Annotations[constants.InjectContainerAnnotation] = strings.Join(migratedContainerLimits, ",")
222220
}
223221
}
224222
if vramLimit, hasValue := parseResourceQuantity(pod, constants.VRAMLimitAnnotation); hasValue {

0 commit comments

Comments
 (0)