@@ -182,7 +182,7 @@ func parseAutoScalingAnnotations(pod *corev1.Pod, workloadProfile *tfv1.Workload
182182
183183func parseGPUResourcesAnnotations (pod * corev1.Pod , workloadProfile * tfv1.WorkloadProfile ) error {
184184 // extract any containers has GPU count limits and set to annotation
185- isMigratedFromContainerLimits := false
185+ migratedContainerLimits := [] string {}
186186 gpuCount , hasValue := pod .Annotations [constants .GpuCountAnnotation ]
187187 if hasValue {
188188 val , err := strconv .ParseInt (gpuCount , 10 , 32 )
@@ -215,8 +215,10 @@ 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 isMigratedFromContainerLimits {
218+ if len ( migratedContainerLimits ) > 0 {
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 , "," )
220222 }
221223 }
222224 if vramLimit , hasValue := parseResourceQuantity (pod , constants .VRAMLimitAnnotation ); hasValue {
0 commit comments