hostsettings

package
v0.0.0-...-5477640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hostsettings provides suggestions or adjustments for host kernel settings to improve runsc performance, stability, or security.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(conf *config.Config) error

Handle deals with host settings according to the given policy.

Types

type Delta

type Delta struct {
	// Name of the setting being changed.
	Name string

	// FromValue is the value of the setting before applying the delta.
	FromValue string

	// ToValue is the value of the setting after applying the delta.
	ToValue string

	// Mandatory indicates whether the delta *must* be applied.
	// This should be set in cases where `runsc` will fail completely
	// if the delta is not applied.
	Mandatory bool

	// Purpose achieved by applying the delta.
	Purpose string

	// Apply applies the delta.
	Apply func() error
}

Delta is a change to make to a host setting.

type Setting

type Setting interface {
	// Name is the name of the setting. In most cases this should be the
	// full path of the setting, either under /sys or /proc/sys.
	// This can be a non-path for settings that are not controlled via files,
	// such as kernel command-line parameters or SELinux labels.
	Name() string

	// Delta checks whether the current value of the setting is optimal.
	// If already optimal, it returns a nil Delta.
	Delta() (*Delta, error)
}

Setting is a host setting to check or adjust.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL