signals

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSignal is the standard error for an invalid signal for a given
	// flavor of container WCOW/LCOW.
	ErrInvalidSignal = errors.New("invalid signal value")
)

Functions

func ValidateLCOW

func ValidateLCOW(signal int, signalsSupported bool) (*guestresource.SignalProcessOptionsLCOW, error)

ValidateLCOW validates that `signal` is an acceptable signal for LCOW based on `signalsSupported`.

If `signalsSupported==false` we verify that only SIGTERM/SIGKILL are sent. All other signals are not supported on downlevel platforms.

func ValidateSigstrLCOW

func ValidateSigstrLCOW(sigstr string, signalsSupported bool) (*guestresource.SignalProcessOptionsLCOW, error)

ValidateSigstrLCOW validates that `sigstr` is an acceptable signal for LCOW based on `signalsSupported`.

`sigstr` may either be the text name or integer value of the signal.

If `signalsSupported==false` we verify that only SIGTERM/SIGKILL are sent. All other signals are not supported on downlevel platforms.

func ValidateSigstrWCOW

func ValidateSigstrWCOW(sigstr string, signalsSupported bool) (*guestresource.SignalProcessOptionsWCOW, error)

ValidateSigstrWCOW validates that `sigstr` is an acceptable signal for WCOW based on `signalsSupported`.

`sigstr` may either be the text name or integer value of the signal.

If `signalsSupported==false` we verify that only SIGTERM/SIGKILL and CTRLSHUTDOWN are sent. All other signals are not supported on downlevel platforms.

By default WCOW orchestrators may still use Linux SIGTERM and SIGKILL semantics which will be properly translated to CTRLSHUTDOWN and `Terminate`. To detect when WCOW needs to `Terminate` the return signal will be `nil` and the return error will be `nil`.

func ValidateWCOW

func ValidateWCOW(signal int, signalsSupported bool) (*guestresource.SignalProcessOptionsWCOW, error)

ValidateWCOW validates that `signal` is an acceptable signal for WCOW based on `signalsSupported`.

If `signalsSupported==false` we verify that only SIGTERM/SIGKILL and CTRLSHUTDOWN are sent. All other signals are not supported on downlevel platforms.

By default WCOW orchestrators may still use Linux SIGTERM and SIGKILL semantics which will be properly translated to CTRLSHUTDOWN and `Terminate`. To detect when WCOW needs to `Terminate` the return signal will be `nil` and the return error will be `nil`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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