@@ -73,7 +73,7 @@ func (c *criService) updateContainerResources(ctx context.Context,
7373 return errors .Wrap (err , "failed to get container spec" )
7474 }
7575 newSpec , err := updateOCILinuxResource (ctx , oldSpec , resources ,
76- c .config .TolerateMissingHugetlbController )
76+ c .config .TolerateMissingHugetlbController , c . config . DisableHugetlbController )
7777 if err != nil {
7878 return errors .Wrap (err , "failed to update resource in spec" )
7979 }
@@ -134,7 +134,7 @@ func updateContainerSpec(ctx context.Context, cntr containerd.Container, spec *r
134134
135135// updateOCILinuxResource updates container resource limit.
136136func updateOCILinuxResource (ctx context.Context , spec * runtimespec.Spec , new * runtime.LinuxContainerResources ,
137- tolerateMissingHugetlbController bool ) (* runtimespec.Spec , error ) {
137+ tolerateMissingHugetlbController , disableHugetlbController bool ) (* runtimespec.Spec , error ) {
138138 // Copy to make sure old spec is not changed.
139139 var cloned runtimespec.Spec
140140 if err := util .DeepCopy (& cloned , spec ); err != nil {
@@ -143,7 +143,7 @@ func updateOCILinuxResource(ctx context.Context, spec *runtimespec.Spec, new *ru
143143 if cloned .Linux == nil {
144144 cloned .Linux = & runtimespec.Linux {}
145145 }
146- if err := opts .WithResources (new , tolerateMissingHugetlbController )(ctx , nil , nil , & cloned ); err != nil {
146+ if err := opts .WithResources (new , tolerateMissingHugetlbController , disableHugetlbController )(ctx , nil , nil , & cloned ); err != nil {
147147 return nil , errors .Wrap (err , "unable to set linux container resources" )
148148 }
149149 return & cloned , nil
0 commit comments