File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -160,13 +160,18 @@ async function processServiceContainers(
160160 )
161161 } )
162162
163- // Only 1 container in a pod can request TPU's.
164- if (
165- services . find (
166- service =>
167- service . resources ?. limits && service . resources . limits [ 'google.com/tpu' ]
163+ const tpuRequestingContainers = services . filter (
164+ service =>
165+ service . resources ?. limits && service . resources . limits [ 'google.com/tpu' ]
166+ )
167+
168+ if ( tpuRequestingContainers . length > 1 ) {
169+ throw new Error (
170+ `${ tpuRequestingContainers . length } containers request for TPU's. Only 1 container per pod can request for TPU's.`
168171 )
169- ) {
172+ }
173+
174+ if ( tpuRequestingContainers . length === 1 ) {
170175 if (
171176 container ?. resources ?. requests &&
172177 container . resources . requests [ 'google.com/tpu' ]
You can’t perform that action at this time.
0 commit comments