common

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComputeNodeLabels = map[string]struct{}{
	"compute": {},
}
View Source
var MasterTaints = map[string]struct{}{
	"node-role.kubernetes.io/control-plane": {},
	"node-role.kubernetes.io/master":        {},
}
View Source
var RoleNodeLabel = "role"

Functions

func AddQueue added in v1.1.0

func AddQueue(sc *configs.SchedulerConfig, partition string, parentPathStr string, newQ configs.QueueConfig) error

func CompareQueueMap

func CompareQueueMap(a map[string]interface{}, b map[string]interface{}) (bool, error)

Takes 2 restClient responses with queue information, and checks if they are the same by

  1. Validates queue name is same
  2. Validates qA and qB have same number of sub-queues 3a. If same queue name and 0 sub-queues, return true 3b. Otherwise, call CompareQueueMap on each child pairing of qA and qB

func CreateBasicConfigMap

func CreateBasicConfigMap() *configs.SchedulerConfig

func CreateJUnitReportDir added in v1.3.0

func CreateJUnitReportDir() error

CreateDirectoryForJunitReports and returns the directory path If the directory cannot be created it'll return an error

func CreateLogFile

func CreateLogFile(suiteName string, specName string, logType string, extension string) (*os.File, error)

func CreateReportDirectory

func CreateReportDirectory() (string, error)

CreateReportDirectory creates and returns the directory path If the directory cannot be created it'll return an error

func GetAbsPath

func GetAbsPath(p string) (string, error)

func GetFileContents

func GetFileContents(filename string) ([]byte, error)

func GetSubQueues

func GetSubQueues(q map[string]interface{}) ([]map[string]interface{}, error)

Returns a list of the children Q's of input. If no children, returns nil

func GetSuiteName added in v1.5.0

func GetSuiteName(testFilePath string) string

func GetTestName

func GetTestName() string

GetTestName returns the test Name in a single string without spaces or /

func GetUUID

func GetUUID() string

func RandSeq

func RandSeq(n int) string

func ReportDirectoryPath

func ReportDirectoryPath() string

ReportDirectoryPath determines the directory path.

func RunShellCmdForeground added in v1.2.0

func RunShellCmdForeground(cmdStr string) (string, error)

func SetNodeSortPolicy added in v1.1.0

func SetNodeSortPolicy(sc *configs.SchedulerConfig, partition string, policy configs.NodeSortingPolicy) error

func SetQueueTimestamp added in v1.1.0

func SetQueueTimestamp(sc *configs.SchedulerConfig, partition string, queuePathStr string) (string, error)

func SetSchedulingPolicy added in v1.1.0

func SetSchedulingPolicy(sc *configs.SchedulerConfig, partition string, queuePathStr string, policy string) error

func SliceExists

func SliceExists(slice interface{}, item interface{}) (bool, error)

func ToYAML added in v1.1.0

func ToYAML(sc *configs.SchedulerConfig) (string, error)

Converts partitionsWrapper to YAML string

func Y2Map

func Y2Map(yamlPath string) (map[interface{}]interface{}, error)

func Yaml2Obj

func Yaml2Obj(yamlPath string) (runtime.Object, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL