om

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SysLog log file
	SysLog = "/var/log/messages"
	// NsenterCmd is nsenter mount command
	NsenterCmd = "/nsenter --mount=/proc/1/ns/mnt"
	// IssueMessageFile tag
	IssueMessageFile = "ISSUE_MESSAGE_FILE"
	// IssueBlockReference tag
	IssueBlockReference = "ISSUE_BLOCK_REFERENCE"
	// IssueOrphanedPod tag
	IssueOrphanedPod = "ISSUE_ORPHANED_POD"
	// MessageFileLines tag
	MessageFileLines = "MESSAGE_FILE_LINES"
)
View Source
const (
	// MountInfo mount file
	MountInfo = "/proc/mounts"
)

Variables

View Source
var (
	// FixedPodList fix pod
	FixedPodList = map[string]string{}
	// K8sMounter mounter
	K8sMounter = k8smount.New("")
)

Functions

func CheckMessageFileIssue

func CheckMessageFileIssue()

CheckMessageFileIssue check/fix issues from message file

func FixOrphanedPodIssue

func FixOrphanedPodIssue(line string) bool

FixOrphanedPodIssue Pod Like: Jul 10 18:55:49 kubelet: E0710 18:55:49.251132 7643 kubelet_volumes.go:154] orphaned pod "a60244b2-e6ee-4a63-b311-13f7b29ef49a" found, but volume paths are still present on disk : There were a total of 1 errors similar to this. Turn up verbosity to see them.

func FixReferenceMountIssue

func FixReferenceMountIssue(line string) bool

FixReferenceMountIssue remove reference links error message: The device %q is still referenced from other Pods;

func GlobalConfigSet

func GlobalConfigSet()

GlobalConfigSet set Global Config

func IsFileExisting

func IsFileExisting(filename string) bool

IsFileExisting check file exist in volume driver;

func ReadFileLinesFromHost

func ReadFileLinesFromHost(fname string) []string

ReadFileLinesFromHost read file from /var/log/messages

func Run

func Run(cmd string) (string, error)

Run run shell command

func StorageOM

func StorageOM()

StorageOM storage Operation and Maintenance

Types

type GlobalConfig

type GlobalConfig struct {
	IssueMessageFile     bool
	MessageFileTailLines int
	IssueBlockReference  bool
	IssueOrphanedPod     bool
}

GlobalConfig save global values for om

var (
	// GlobalConfigVar var
	GlobalConfigVar GlobalConfig
)

Jump to

Keyboard shortcuts

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