Clean cri options and useless parms
Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
This commit is contained in:
parent
c03290cb00
commit
df26c189af
@ -357,7 +357,7 @@ func WithResources(resources *runtime.LinuxContainerResources, tolerateMissingHu
|
|||||||
s.Linux.Resources.CPU.Cpus = cpus
|
s.Linux.Resources.CPU.Cpus = cpus
|
||||||
}
|
}
|
||||||
if mems := resources.GetCpusetMems(); mems != "" {
|
if mems := resources.GetCpusetMems(); mems != "" {
|
||||||
s.Linux.Resources.CPU.Mems = resources.GetCpusetMems()
|
s.Linux.Resources.CPU.Mems = mems
|
||||||
}
|
}
|
||||||
if limit != 0 {
|
if limit != 0 {
|
||||||
s.Linux.Resources.Memory.Limit = &limit
|
s.Linux.Resources.Memory.Limit = &limit
|
||||||
|
@ -556,7 +556,6 @@ func (c *criService) buildContainerSpec(
|
|||||||
id,
|
id,
|
||||||
sandboxID,
|
sandboxID,
|
||||||
sandboxPid,
|
sandboxPid,
|
||||||
netNSPath,
|
|
||||||
containerName,
|
containerName,
|
||||||
imageName,
|
imageName,
|
||||||
config,
|
config,
|
||||||
@ -568,9 +567,7 @@ func (c *criService) buildContainerSpec(
|
|||||||
)
|
)
|
||||||
case isWindows:
|
case isWindows:
|
||||||
specOpts, err = c.buildWindowsSpec(
|
specOpts, err = c.buildWindowsSpec(
|
||||||
id,
|
|
||||||
sandboxID,
|
sandboxID,
|
||||||
sandboxPid,
|
|
||||||
netNSPath,
|
netNSPath,
|
||||||
containerName,
|
containerName,
|
||||||
imageName,
|
imageName,
|
||||||
@ -579,11 +576,9 @@ func (c *criService) buildContainerSpec(
|
|||||||
imageConfig,
|
imageConfig,
|
||||||
extraMounts,
|
extraMounts,
|
||||||
ociRuntime,
|
ociRuntime,
|
||||||
runtimeHandler,
|
|
||||||
)
|
)
|
||||||
case isDarwin:
|
case isDarwin:
|
||||||
specOpts, err = c.buildDarwinSpec(
|
specOpts, err = c.buildDarwinSpec(
|
||||||
id,
|
|
||||||
sandboxID,
|
sandboxID,
|
||||||
containerName,
|
containerName,
|
||||||
imageName,
|
imageName,
|
||||||
@ -592,7 +587,6 @@ func (c *criService) buildContainerSpec(
|
|||||||
imageConfig,
|
imageConfig,
|
||||||
extraMounts,
|
extraMounts,
|
||||||
ociRuntime,
|
ociRuntime,
|
||||||
runtimeHandler,
|
|
||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported spec platform: %s", platform.OS)
|
return nil, fmt.Errorf("unsupported spec platform: %s", platform.OS)
|
||||||
@ -609,7 +603,6 @@ func (c *criService) buildLinuxSpec(
|
|||||||
id string,
|
id string,
|
||||||
sandboxID string,
|
sandboxID string,
|
||||||
sandboxPid uint32,
|
sandboxPid uint32,
|
||||||
netNSPath string,
|
|
||||||
containerName string,
|
containerName string,
|
||||||
imageName string,
|
imageName string,
|
||||||
config *runtime.ContainerConfig,
|
config *runtime.ContainerConfig,
|
||||||
@ -839,9 +832,7 @@ func (c *criService) buildLinuxSpec(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *criService) buildWindowsSpec(
|
func (c *criService) buildWindowsSpec(
|
||||||
id string,
|
|
||||||
sandboxID string,
|
sandboxID string,
|
||||||
sandboxPid uint32,
|
|
||||||
netNSPath string,
|
netNSPath string,
|
||||||
containerName string,
|
containerName string,
|
||||||
imageName string,
|
imageName string,
|
||||||
@ -850,7 +841,6 @@ func (c *criService) buildWindowsSpec(
|
|||||||
imageConfig *imagespec.ImageConfig,
|
imageConfig *imagespec.ImageConfig,
|
||||||
extraMounts []*runtime.Mount,
|
extraMounts []*runtime.Mount,
|
||||||
ociRuntime criconfig.Runtime,
|
ociRuntime criconfig.Runtime,
|
||||||
runtimeHandler *runtime.RuntimeHandler,
|
|
||||||
) (_ []oci.SpecOpts, retErr error) {
|
) (_ []oci.SpecOpts, retErr error) {
|
||||||
var specOpts []oci.SpecOpts
|
var specOpts []oci.SpecOpts
|
||||||
specOpts = append(specOpts, customopts.WithProcessCommandLineOrArgsForWindows(config, imageConfig))
|
specOpts = append(specOpts, customopts.WithProcessCommandLineOrArgsForWindows(config, imageConfig))
|
||||||
@ -936,7 +926,6 @@ func (c *criService) buildWindowsSpec(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *criService) buildDarwinSpec(
|
func (c *criService) buildDarwinSpec(
|
||||||
id string,
|
|
||||||
sandboxID string,
|
sandboxID string,
|
||||||
containerName string,
|
containerName string,
|
||||||
imageName string,
|
imageName string,
|
||||||
@ -945,7 +934,6 @@ func (c *criService) buildDarwinSpec(
|
|||||||
imageConfig *imagespec.ImageConfig,
|
imageConfig *imagespec.ImageConfig,
|
||||||
extraMounts []*runtime.Mount,
|
extraMounts []*runtime.Mount,
|
||||||
ociRuntime criconfig.Runtime,
|
ociRuntime criconfig.Runtime,
|
||||||
runtimeHandler *runtime.RuntimeHandler,
|
|
||||||
) (_ []oci.SpecOpts, retErr error) {
|
) (_ []oci.SpecOpts, retErr error) {
|
||||||
specOpts := []oci.SpecOpts{
|
specOpts := []oci.SpecOpts{
|
||||||
customopts.WithProcessArgs(config, imageConfig),
|
customopts.WithProcessArgs(config, imageConfig),
|
||||||
|
Loading…
Reference in New Issue
Block a user