From df26c189af8a684b2c46974c1ec183ba9b941d4e Mon Sep 17 00:00:00 2001 From: zhanluxianshen Date: Wed, 13 Mar 2024 01:04:15 +0000 Subject: [PATCH] Clean cri options and useless parms Signed-off-by: zhanluxianshen --- internal/cri/opts/spec_linux_opts.go | 2 +- internal/cri/server/container_create.go | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/internal/cri/opts/spec_linux_opts.go b/internal/cri/opts/spec_linux_opts.go index 3972c73522d1..1ba691343f3c 100644 --- a/internal/cri/opts/spec_linux_opts.go +++ b/internal/cri/opts/spec_linux_opts.go @@ -357,7 +357,7 @@ func WithResources(resources *runtime.LinuxContainerResources, tolerateMissingHu s.Linux.Resources.CPU.Cpus = cpus } if mems := resources.GetCpusetMems(); mems != "" { - s.Linux.Resources.CPU.Mems = resources.GetCpusetMems() + s.Linux.Resources.CPU.Mems = mems } if limit != 0 { s.Linux.Resources.Memory.Limit = &limit diff --git a/internal/cri/server/container_create.go b/internal/cri/server/container_create.go index f6ec18e91d1b..f1bb9ddf5c76 100644 --- a/internal/cri/server/container_create.go +++ b/internal/cri/server/container_create.go @@ -556,7 +556,6 @@ func (c *criService) buildContainerSpec( id, sandboxID, sandboxPid, - netNSPath, containerName, imageName, config, @@ -568,9 +567,7 @@ func (c *criService) buildContainerSpec( ) case isWindows: specOpts, err = c.buildWindowsSpec( - id, sandboxID, - sandboxPid, netNSPath, containerName, imageName, @@ -579,11 +576,9 @@ func (c *criService) buildContainerSpec( imageConfig, extraMounts, ociRuntime, - runtimeHandler, ) case isDarwin: specOpts, err = c.buildDarwinSpec( - id, sandboxID, containerName, imageName, @@ -592,7 +587,6 @@ func (c *criService) buildContainerSpec( imageConfig, extraMounts, ociRuntime, - runtimeHandler, ) default: return nil, fmt.Errorf("unsupported spec platform: %s", platform.OS) @@ -609,7 +603,6 @@ func (c *criService) buildLinuxSpec( id string, sandboxID string, sandboxPid uint32, - netNSPath string, containerName string, imageName string, config *runtime.ContainerConfig, @@ -839,9 +832,7 @@ func (c *criService) buildLinuxSpec( } func (c *criService) buildWindowsSpec( - id string, sandboxID string, - sandboxPid uint32, netNSPath string, containerName string, imageName string, @@ -850,7 +841,6 @@ func (c *criService) buildWindowsSpec( imageConfig *imagespec.ImageConfig, extraMounts []*runtime.Mount, ociRuntime criconfig.Runtime, - runtimeHandler *runtime.RuntimeHandler, ) (_ []oci.SpecOpts, retErr error) { var specOpts []oci.SpecOpts specOpts = append(specOpts, customopts.WithProcessCommandLineOrArgsForWindows(config, imageConfig)) @@ -936,7 +926,6 @@ func (c *criService) buildWindowsSpec( } func (c *criService) buildDarwinSpec( - id string, sandboxID string, containerName string, imageName string, @@ -945,7 +934,6 @@ func (c *criService) buildDarwinSpec( imageConfig *imagespec.ImageConfig, extraMounts []*runtime.Mount, ociRuntime criconfig.Runtime, - runtimeHandler *runtime.RuntimeHandler, ) (_ []oci.SpecOpts, retErr error) { specOpts := []oci.SpecOpts{ customopts.WithProcessArgs(config, imageConfig),