mirror of
https://github.com/containers/podman.git
synced 2025-07-17 17:43:23 +08:00
Remove unused fields from runtime config
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #212 Approved by: rhatdan
This commit is contained in:
@ -200,33 +200,6 @@ func WithTmpDir(dir string) RuntimeOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithSELinux enables SELinux on the container server
|
|
||||||
func WithSELinux() RuntimeOption {
|
|
||||||
return func(rt *Runtime) error {
|
|
||||||
if rt.valid {
|
|
||||||
return ErrRuntimeFinalized
|
|
||||||
}
|
|
||||||
|
|
||||||
rt.config.SelinuxEnabled = true
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithPidsLimit specifies the maximum number of processes each container is
|
|
||||||
// restricted to
|
|
||||||
func WithPidsLimit(limit int64) RuntimeOption {
|
|
||||||
return func(rt *Runtime) error {
|
|
||||||
if rt.valid {
|
|
||||||
return ErrRuntimeFinalized
|
|
||||||
}
|
|
||||||
|
|
||||||
rt.config.PidsLimit = limit
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithMaxLogSize sets the maximum size of container logs
|
// WithMaxLogSize sets the maximum size of container logs
|
||||||
// Positive sizes are limits in bytes, -1 is unlimited
|
// Positive sizes are limits in bytes, -1 is unlimited
|
||||||
func WithMaxLogSize(limit int64) RuntimeOption {
|
func WithMaxLogSize(limit int64) RuntimeOption {
|
||||||
|
@ -46,8 +46,6 @@ type RuntimeConfig struct {
|
|||||||
CgroupManager string
|
CgroupManager string
|
||||||
StaticDir string
|
StaticDir string
|
||||||
TmpDir string
|
TmpDir string
|
||||||
SelinuxEnabled bool
|
|
||||||
PidsLimit int64
|
|
||||||
MaxLogSize int64
|
MaxLogSize int64
|
||||||
NoPivotRoot bool
|
NoPivotRoot bool
|
||||||
CNIConfigDir string
|
CNIConfigDir string
|
||||||
@ -65,15 +63,13 @@ var (
|
|||||||
ConmonEnvVars: []string{
|
ConmonEnvVars: []string{
|
||||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||||
},
|
},
|
||||||
CgroupManager: "cgroupfs",
|
CgroupManager: "cgroupfs",
|
||||||
StaticDir: filepath.Join(storage.DefaultStoreOptions.GraphRoot, "libpod"),
|
StaticDir: filepath.Join(storage.DefaultStoreOptions.GraphRoot, "libpod"),
|
||||||
TmpDir: "/var/run/libpod",
|
TmpDir: "/var/run/libpod",
|
||||||
SelinuxEnabled: false,
|
MaxLogSize: -1,
|
||||||
PidsLimit: 1024,
|
NoPivotRoot: false,
|
||||||
MaxLogSize: -1,
|
CNIConfigDir: "/etc/cni/net.d/",
|
||||||
NoPivotRoot: false,
|
CNIPluginDir: []string{"/usr/libexec/cni", "/opt/cni/bin"},
|
||||||
CNIConfigDir: "/etc/cni/net.d/",
|
|
||||||
CNIPluginDir: []string{"/usr/libexec/cni", "/opt/cni/bin"},
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -323,6 +319,7 @@ func (r *Runtime) refresh(alivePath string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a file indicating the runtime is alive and ready
|
||||||
file, err := os.OpenFile(alivePath, os.O_RDONLY|os.O_CREATE, 0644)
|
file, err := os.OpenFile(alivePath, os.O_RDONLY|os.O_CREATE, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error creating runtime status file %s", alivePath)
|
return errors.Wrapf(err, "error creating runtime status file %s", alivePath)
|
||||||
|
Reference in New Issue
Block a user