nodetainted

package
v0.0.0-...-9c8cfac Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeKernelTaintsFromBitMask

func DecodeKernelTaintsFromBitMask(bitmask uint64) []string

func DecodeKernelTaintsFromLetters

func DecodeKernelTaintsFromLetters(letters string) []string

func GetOtherTaintedBits

func GetOtherTaintedBits(taintsMask uint64, taintedBitsByModules map[int]bool) []int

GetOtherTaintedBits helper function to get the tainted bits that are not related to any module.

func GetTaintMsg

func GetTaintMsg(bit int) string

func GetTaintedBitsByModules

func GetTaintedBitsByModules(tainters map[string]string) (map[int]bool, error)

GetTaintedBitsByModules helper function to gets, for each module, the taint bits from its taint letters.

func RemoveAllExceptNumbers

func RemoveAllExceptNumbers(incomingStr string) string

Types

type KernelTaint

type KernelTaint struct {
	Description string
	Letters     string
}

type NodeTainted

type NodeTainted struct {
	// contains filtered or unexported fields
}

NodeTainted holds information about tainted nodes.

func NewNodeTaintedTester

func NewNodeTaintedTester(context *clientsholder.Context, node string) *NodeTainted

NewNodeTainted creates a new NodeTainted tester

func (*NodeTainted) GetKernelTaintsMask

func (nt *NodeTainted) GetKernelTaintsMask() (uint64, error)

func (*NodeTainted) GetTainterModules

func (nt *NodeTainted) GetTainterModules(allowList map[string]bool) (tainters map[string]string, taintBits map[int]bool, err error)

GetTainterModules runs a command in the node to get all the modules that have set a kernel taint bit. Returns:

  • tainters: maps a module to a string of taints letters. Each letter maps to a single bit in the taint mask. Tainters that appear in the allowlist will not be added to this map.
  • taintBits: bits (pos) of kernel taints caused by all modules (included the allowlisted ones).

Jump to

Keyboard shortcuts

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