Skip to content

Commit

Permalink
Merge pull request containerd#9961 from zhanluxianshen/clean-cri-opts
Browse files Browse the repository at this point in the history
Clean cri options and useless parms
  • Loading branch information
mxpv authored Mar 19, 2024
2 parents 2986e45 + df26c18 commit 9a4231d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion internal/cri/opts/spec_linux_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions internal/cri/server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ func (c *criService) buildContainerSpec(
id,
sandboxID,
sandboxPid,
netNSPath,
containerName,
imageName,
config,
Expand All @@ -568,9 +567,7 @@ func (c *criService) buildContainerSpec(
)
case isWindows:
specOpts, err = c.buildWindowsSpec(
id,
sandboxID,
sandboxPid,
netNSPath,
containerName,
imageName,
Expand All @@ -579,11 +576,9 @@ func (c *criService) buildContainerSpec(
imageConfig,
extraMounts,
ociRuntime,
runtimeHandler,
)
case isDarwin:
specOpts, err = c.buildDarwinSpec(
id,
sandboxID,
containerName,
imageName,
Expand All @@ -592,7 +587,6 @@ func (c *criService) buildContainerSpec(
imageConfig,
extraMounts,
ociRuntime,
runtimeHandler,
)
default:
return nil, fmt.Errorf("unsupported spec platform: %s", platform.OS)
Expand All @@ -609,7 +603,6 @@ func (c *criService) buildLinuxSpec(
id string,
sandboxID string,
sandboxPid uint32,
netNSPath string,
containerName string,
imageName string,
config *runtime.ContainerConfig,
Expand Down Expand Up @@ -839,9 +832,7 @@ func (c *criService) buildLinuxSpec(
}

func (c *criService) buildWindowsSpec(
id string,
sandboxID string,
sandboxPid uint32,
netNSPath string,
containerName string,
imageName string,
Expand All @@ -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))
Expand Down Expand Up @@ -936,7 +926,6 @@ func (c *criService) buildWindowsSpec(
}

func (c *criService) buildDarwinSpec(
id string,
sandboxID string,
containerName string,
imageName string,
Expand All @@ -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),
Expand Down

0 comments on commit 9a4231d

Please sign in to comment.