Documentation
¶
Overview ¶
Package hostop contains an interface to represent the execution of atomic host operations at a higher privilege.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostPidNamespace ¶ added in v0.0.5
HostPidNamespace checks whether the current process is using host's PID namespace.
func InsideContainer ¶
func InsideContainer() bool
InsideContainer checks whether the current process is being executed inside of a container.
Types ¶
type HostOp ¶
type HostOp interface { // Do executes the action at a privileged context at the host. Do(action func() error) error }
func NewMountHostOp ¶
func NewMountHostOp(opts ...HostOpOption) HostOp
type HostOpOption ¶ added in v0.1.0
type HostOpOption func(*hostOpOpts)
func WithAssumeContainer ¶ added in v0.1.0
func WithAssumeContainer() HostOpOption
WithAssumeContainer ensures that HostOp always assume it is being executed from inside a container, and therefore attempts the necessary privilege escalations.
func WithAssumeHost ¶ added in v0.1.0
func WithAssumeHost() HostOpOption
WithAssumeHost ensures that HostOp always assume that it is being executed directly in the host.
func WithContainerDetection ¶ added in v0.1.0
func WithContainerDetection() HostOpOption
WithContainerDetection ensures that HostOp tries to auto detect whether or not the code is being executed from inside a container.
func WithLogger ¶ added in v0.1.0
func WithLogger(logger logr.Logger) HostOpOption
WithLogger sets a logger to be used whilst executing operations.