mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
SHM size must be greater than 0
This commit is contained in:
parent
9ec92559e5
commit
cbf1cb81a9
@ -55,6 +55,9 @@ type kubeDockerClient struct {
|
||||
// Make sure that kubeDockerClient implemented the DockerInterface.
|
||||
var _ DockerInterface = &kubeDockerClient{}
|
||||
|
||||
// the default ShmSize to use (in bytes) if not specified.
|
||||
const defaultShmSize = int64(1024 * 1024 * 64)
|
||||
|
||||
// newKubeDockerClient creates an kubeDockerClient from an existing docker client.
|
||||
func newKubeDockerClient(dockerClient *dockerapi.Client) DockerInterface {
|
||||
return &kubeDockerClient{
|
||||
@ -126,6 +129,11 @@ func (d *kubeDockerClient) InspectContainer(id string) (*dockertypes.ContainerJS
|
||||
}
|
||||
|
||||
func (d *kubeDockerClient) CreateContainer(opts dockertypes.ContainerCreateConfig) (*dockertypes.ContainerCreateResponse, error) {
|
||||
// we provide an explicit default shm size as to not depend on docker daemon.
|
||||
// TODO: evaluate exposing this as a knob in the API
|
||||
if opts.HostConfig != nil && opts.HostConfig.ShmSize <= 0 {
|
||||
opts.HostConfig.ShmSize = defaultShmSize
|
||||
}
|
||||
createResp, err := d.client.ContainerCreate(getDefaultContext(), opts.Config, opts.HostConfig, opts.NetworkingConfig, opts.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user