Documentation ¶
Index ¶
- Variables
- func AddPubKeyIntoAuthorizedKeys(pubkey string) error
- func AddUniqueStringItem(items []string, itemToAdd string) []string
- func Bash(cmd string) (string, error)
- func BuildInClusterClientset() (*kubernetes.Clientset, error)
- func BuildStoragePoolName(poolClass string) (string, error)
- func ConvertBytesToStr(size int64) string
- func ConvertLVMBytesToNumeric(lvmbyte string) (int64, error)
- func ConvertNumericToLVMBytes(num int64) string
- func GetNamespace() string
- func GetNodeName() string
- func GetPodName() string
- func GetSnapshotRestoreNameByVolume(volumeName string) string
- func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func NumericToLVMBytes(bytes int64) int64
- func ParseBytes(sizeStr string) (int64, error)
- func RemovePubKeyFromAuthorizedKeys() error
- func RemoveStringItem(items []string, itemToDelete string) []string
- func RunWithLease(ns string, identity string, lockName string, runFunc func(ctx context.Context)) error
- func SanitizeName(name string) string
- func TouchFile(filepath string) error
- type PCIDiskInfo
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotLVMByteNum = errors.New("LVM byte format unrecognised")
)
Functions ¶
func AddUniqueStringItem ¶
AddUniqueStringItem add a string from a slice without duplicate
func BuildInClusterClientset ¶
func BuildInClusterClientset() (*kubernetes.Clientset, error)
BuildInClusterClientset builds a kubernetes in-cluster clientset
func BuildStoragePoolName ¶
BuildStoragePoolName constructs storage pool name
func ConvertBytesToStr ¶
ConvertBytesToStr convert size into string
func GetNamespace ¶
func GetNamespace() string
GetNamespace get Namespace from env, else it returns error
func GetNodeName ¶
func GetNodeName() string
GetNodeName gets the node name from env, else returns an error
func GetPodName ¶
func GetPodName() string
func LogGRPC ¶
func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
LogGRPC log grpc all info
func NumericToLVMBytes ¶
func ParseBytes ¶
ParseBytes parse size from string into bytes
func RemovePubKeyFromAuthorizedKeys ¶
func RemovePubKeyFromAuthorizedKeys() error
func RemoveStringItem ¶
RemoveStringItem removes a string from a slice
func RunWithLease ¶
func RunWithLease(ns string, identity string, lockName string, runFunc func(ctx context.Context)) error
RunWithLease run a process with acquired leader lease. It's a blocking function
func SanitizeName ¶
SanitizeName sanitizes the provided string so it can be consumed by leader election library copy from github.com/kubernetes-csi/csi-lib-utils/leaderelection
Types ¶
type PCIDiskInfo ¶
type PCIDiskInfo struct {
// contains filtered or unexported fields
}
PCIDiskInfo struct