File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
pkg/binder/plugins/gpusharing/gpu-request Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,32 @@ func TestValidateGpuRequests(t *testing.T) {
182182 },
183183 error : fmt .Errorf ("cannot request both GPU and GPU memory" ),
184184 },
185+ {
186+ name : "forbid GPU resource limit in sidecar container with GPU Memory fraction annotation" ,
187+ pod : & v1.Pod {
188+ ObjectMeta : metav1.ObjectMeta {
189+ Annotations : map [string ]string {
190+ constants .GpuMemory : "1" ,
191+ },
192+ },
193+ Spec : v1.PodSpec {
194+ Containers : []v1.Container {
195+ {
196+ Name : "SneakyGPUContainer" ,
197+ Resources : v1.ResourceRequirements {},
198+ },
199+ {
200+ Resources : v1.ResourceRequirements {
201+ Limits : v1.ResourceList {
202+ constants .GpuResource : * resource .NewMilliQuantity (1 , resource .DecimalSI ),
203+ },
204+ },
205+ },
206+ },
207+ },
208+ },
209+ error : fmt .Errorf ("cannot request both GPU and GPU memory" ),
210+ },
185211 {
186212 name : "forbid negative GPU memory annotation" ,
187213 pod : & v1.Pod {
You can’t perform that action at this time.
0 commit comments