File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,23 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
309309 c .FuzzNoCustom (ct ) // fuzz self without calling this function again
310310 ct .TerminationMessagePath = "/" + ct .TerminationMessagePath // Must be non-empty
311311 ct .TerminationMessagePolicy = "File"
312+ // Match defaulting in pkg/apis/core/v1/defaults.go.
313+ _ , hasCPUReq := ct .Resources .Requests [core .ResourceCPU ]
314+ _ , hasCPULim := ct .Resources .Limits [core .ResourceCPU ]
315+ _ , hasMemReq := ct .Resources .Requests [core .ResourceMemory ]
316+ _ , hasMemLim := ct .Resources .Limits [core .ResourceMemory ]
317+ if hasCPUReq || hasCPULim {
318+ ct .ResizePolicy = append (ct .ResizePolicy , core.ContainerResizePolicy {
319+ ResourceName : core .ResourceCPU ,
320+ RestartPolicy : core .NotRequired ,
321+ })
322+ }
323+ if hasMemReq || hasMemLim {
324+ ct .ResizePolicy = append (ct .ResizePolicy , core.ContainerResizePolicy {
325+ ResourceName : core .ResourceMemory ,
326+ RestartPolicy : core .NotRequired ,
327+ })
328+ }
312329 },
313330 func (ep * core.EphemeralContainer , c fuzz.Continue ) {
314331 c .FuzzNoCustom (ep ) // fuzz self without calling this function again
You can’t perform that action at this time.
0 commit comments