Documentation
¶
Overview ¶
Copyright 2019 PingCAP, Inc.
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, See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func EnsureDirectoryExist(dirName string) error
- func FindInPath(binary string, paths []string) (string, error)
- func GenURL(url string) string
- func GetContainerStatusFromPod(pod *corev1.Pod, cond func(corev1.ContainerStatus) bool) *corev1.ContainerStatus
- func GetHostname(hostnameOverride string) (string, error)
- func ListK8sNodes(kubectlPath, labels string) ([]string, error)
- func OpenDB(dsn string, maxIdleConns int) (*sql.DB, error)
- func ParseTemplate(strtmpl string, obj interface{}) ([]byte, error)
- func RandString(n int) string
- func Sleep(ctx context.Context, sleepTime time.Duration)
Constants ¶
const (
// LabelNodeRoleMaster specifies that a node is a master
LabelNodeRoleMaster = "node-role.kubernetes.io/master"
)
Variables ¶
var ExecutableFileExtensions = []string{""}
Valid file extensions for plugin executables.
Functions ¶
func EnsureDirectoryExist ¶
EnsureDirectoryExist create directory if does not exist
func FindInPath ¶
FindInPath returns the full path of the binary by searching in the provided path
func GetContainerStatusFromPod ¶
func GetContainerStatusFromPod(pod *corev1.Pod, cond func(corev1.ContainerStatus) bool) *corev1.ContainerStatus
func GetHostname ¶
GetHostname returns OS's hostname if 'hostnameOverride' is empty; otherwise, return 'hostnameOverride'.
func ListK8sNodes ¶
ListK8sNodes returns k8s nodes base on node labels
func ParseTemplate ¶
ParseTemplate validates and parses passed as argument template
func RandString ¶
RandString reference: http://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang
Types ¶
This section is empty.