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
- Variables
- func CheckMessageFileIssue()
- func FixOrphanedPodIssue(line string) bool
- func FixReferenceMountIssue(line string) bool
- func GlobalConfigSet()
- func IsDirEmpty(name string) (bool, error)
- func IsFileExisting(filename string) bool
- func ReadFileLinesFromHost(fname string) []string
- func Run(cmd string) (string, error)
- func StorageOM()
- type GlobalConfig
Constants ¶
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" )
const (
// MountInfo mount file
MountInfo = "/proc/mounts"
)
Variables ¶
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 ¶
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 ¶
FixReferenceMountIssue remove reference links error message: The device %q is still referenced from other Pods;
func IsDirEmpty ¶
IsDirEmpty return status of dir empty or not
func IsFileExisting ¶
IsFileExisting check file exist in volume driver;
func ReadFileLinesFromHost ¶
ReadFileLinesFromHost read file from /var/log/messages
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 )