@@ -201,6 +201,11 @@ func mutatePod(w http.ResponseWriter, r *http.Request) {
201
201
}
202
202
}
203
203
204
+ if podClass == PodClassBuilds &&
205
+ labels ["ci.openshift.io/metadata.repo" ] == "hypershift" {
206
+ podClass = PodClassBuildsTmpfs
207
+ }
208
+
204
209
if podClass != PodClassNone {
205
210
profile ("classified request" )
206
211
@@ -347,6 +352,22 @@ func mutatePod(w http.ResponseWriter, r *http.Request) {
347
352
addPatchEntry ("add" , "/spec/affinity" , unstructuredAffinity )
348
353
}
349
354
355
+ if podClass == PodClassBuildsTmpfs {
356
+ // Iterate over pod volumes and set medium to memory for container-storage-root and container-storage-run volumes
357
+ for i , volume := range pod .Spec .Volumes {
358
+ if volume .Name == "container-storage-root" || volume .Name == "container-storage-run" {
359
+ addPatchEntry ("add" , fmt .Sprintf ("/spec/volumes/%v/emptyDir/medium" , i ), "Memory" )
360
+ }
361
+ }
362
+
363
+ // Find the docker-build container and remove its memory request
364
+ for i , container := range pod .Spec .Containers {
365
+ if container .Name == "docker-build" {
366
+ addPatchEntry ("remove" , fmt .Sprintf ("/spec/containers/%v/resources/requests/memory" , i ), nil )
367
+ }
368
+ }
369
+ }
370
+
350
371
// There is currently an issue with cluster scale up where pods are stacked up, unschedulable.
351
372
// A machine is provisioned. As soon as the machine is provisioned, pods are scheduled to the
352
373
// node and they begin to run before DNS daemonset pods can successfully configure the pod.
0 commit comments