Documentation
¶
Index ¶
- Variables
- func AddUniqueStringItem(items []string, itemToAdd string) []string
- func BuildInClusterClientset() (*kubernetes.Clientset, error)
- func BuildStoragePoolName(poolClass string, poolType 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 GetPCIDisks(cmdExec exechelper.Executor) (map[string]*PCIDiskInfo, error)
- func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func LogREST(inner http.Handler, name string) http.Handler
- func NumericToLVMBytes(bytes int64) int64
- func ParseBytes(sizeStr string) (int64, error)
- func PrettyPrintJSON(v interface{})
- 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
- 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 ConvertLVMBytesToNumeric ¶ added in v0.0.2
func ConvertNumericToLVMBytes ¶ added in v0.0.2
func GetNamespace ¶ added in v0.1.10
func GetNamespace() string
GetNamespace get Namespace from env, else it returns error
func GetNodeName ¶ added in v0.1.10
func GetNodeName() string
GetNodeName gets the node name from env, else returns an error
func GetPCIDisks ¶
func GetPCIDisks(cmdExec exechelper.Executor) (map[string]*PCIDiskInfo, error)
GetPCIDisks gets pci disks info on the local node
func LogGRPC ¶
func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
LogGRPC log grpc all info
func NumericToLVMBytes ¶ added in v0.0.2
func ParseBytes ¶
ParseBytes parse size from string into bytes
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