om

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright © 2021 Alibaba Group Holding Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// SysLog log file
	SysLog = "/var/log/messages"
	// 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 IsDirEmpty

func IsDirEmpty(name string) (bool, error)

IsDirEmpty return status of dir empty or not

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