Documentation ¶
Index ¶
- Constants
- func AcquireAllPods(namespace string, client *kubernetes.Clientset) ([]v1.Pod, error)
- func AcquireServingServices(namespace string, client *kubernetes.Clientset) ([]v1.Service, error)
- func GetChartsFolder() string
- func GetClientSetForTest(t *testing.T) *kubernetes.Clientset
- func IsConnectionRefusedError(err error) bool
- func IsNeedWaitError(err error) bool
- func IsUnexpectedEOFError(err error) bool
- func ParseDataDirRaw(raw string) (hostPath, containerPath string, err error)
- func RandomInt32() string
- func Retry(attempts int, sleep time.Duration, callback func() error) (err error)
- func RetryDuring(duration time.Duration, sleep time.Duration, callback func() error) (err error)
- func SelectAvailablePort(client *kubernetes.Clientset) (int, error)
- func SelectAvailablePortWithDefault(client *kubernetes.Clientset, port int) (int, error)
- func SetLogLevel(level string)
- func ShortHumanDuration(d time.Duration) string
- func StringInSlice(x string, list []string) bool
- func ValidateDatasets(dataset []string) (err error)
- func ValidateJobName(value string) error
- func ValidatePriorityClassName(client *kubernetes.Clientset, name string) error
Constants ¶
View Source
const AUTO_SELECT_PORT_MAX = 30000
View Source
const AUTO_SELECT_PORT_MIN = 20000
View Source
const DNS1123LabelMaxLength int = 63
View Source
const DNS1123SubdomainMaxLength int = 253
View Source
const JobMaxLength int = 49
Job Max lenth should be 49
Variables ¶
This section is empty.
Functions ¶
func AcquireAllPods ¶
func AcquireServingServices ¶
func GetChartsFolder ¶
func GetChartsFolder() string
func GetClientSetForTest ¶
func GetClientSetForTest(t *testing.T) *kubernetes.Clientset
func IsNeedWaitError ¶
func IsUnexpectedEOFError ¶
func ParseDataDirRaw ¶
ParseDataDirRaw parse DataDir into hostPath, containerPath
func RetryDuring ¶
func SelectAvailablePort ¶
func SelectAvailablePort(client *kubernetes.Clientset) (int, error)
Select a available port in range (AUTO_SELECT_PORT_MIN ~ AUTO_SELECT_PORT_MAX), and exclude used ports in k8s if 20000 is selected this time, make sure next time it will select 20001
func SelectAvailablePortWithDefault ¶
func SelectAvailablePortWithDefault(client *kubernetes.Clientset, port int) (int, error)
If default port is available, use it If not set defaultPort, select port automatically
func ShortHumanDuration ¶
ShortHumanDuration returns a succint representation of the provided duration with limited precision for consumption by humans.
func StringInSlice ¶ added in v0.3.0
func ValidateDatasets ¶
func ValidateJobName ¶
ValidateJobName validates the job name, its length should less than 63, and match dns1123LabelFmt
func ValidatePriorityClassName ¶
func ValidatePriorityClassName(client *kubernetes.Clientset, name string) error
Check if PriorityClassName exists
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.