Documentation ¶
Index ¶
- func Convert2Pod(obj interface{}) (*v1.Pod, error)
- func FindAppTaskGroup(appTaskGroups []*v1alpha1.TaskGroup, groupName string) (*v1alpha1.TaskGroup, error)
- func GeneralPodFilter(pod *v1.Pod) bool
- func GeneratePlaceholderName(taskGroupName, appID string, index int32) string
- func GetApplicationIDFromPod(pod *v1.Pod) (string, error)
- func GetNamespaceQuotaFromAnnotation(namespaceObj *v1.Namespace) *si.Resource
- func GetPlaceholderFlagFromPodSpec(pod *v1.Pod) bool
- func GetPlaceholderResourceRequest(resources map[string]resource.Quantity) v1.ResourceList
- func GetQueueNameFromPod(pod *v1.Pod) string
- func GetSchedulingPolicyParam(pod *v1.Pod) *interfaces.SchedulingPolicyParameters
- func GetTaskGroupFromPodSpec(pod *v1.Pod) string
- func GetTaskGroupsFromAnnotation(pod *v1.Pod) ([]v1alpha1.TaskGroup, error)
- func GetUserFromPod(pod *v1.Pod) string
- func IsAssignedPod(pod *v1.Pod) bool
- func IsPodRunning(pod *v1.Pod) bool
- func IsPodTerminated(pod *v1.Pod) bool
- func MergeMaps(first, second map[string]string) map[string]string
- func NeedRecovery(pod *v1.Pod) bool
- func NewK8sResourceList(resources ...K8sResource) map[v1.ResourceName]resource.Quantity
- func NodeForTest(nodeID, memory, cpu string) *v1.Node
- func PodForTest(podName, memory, cpu string) *v1.Pod
- func PodUnderCondition(pod *v1.Pod, condition *v1.PodCondition) bool
- func WaitForCondition(eval func() bool, interval time.Duration, timeout time.Duration) error
- type K8sResource
- type TaskGroupInstanceCountMap
- func (t *TaskGroupInstanceCountMap) Add(taskGroupName string, num int32)
- func (t *TaskGroupInstanceCountMap) AddOne(taskGroupName string)
- func (t *TaskGroupInstanceCountMap) DeleteOne(taskGroupName string)
- func (t *TaskGroupInstanceCountMap) Equals(target *TaskGroupInstanceCountMap) bool
- func (t *TaskGroupInstanceCountMap) GetTaskGroupInstanceCount(groupName string) int32
- func (t *TaskGroupInstanceCountMap) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert2Pod ¶
func FindAppTaskGroup ¶
func GeneralPodFilter ¶
func GeneratePlaceholderName ¶
the placeholder name is the pod name, pod name can not be longer than 63 chars, taskGroup name and appID will be truncated if they go over 20/28 chars respectively, each taskGroup is assigned with an incremental index starting from 0.
func GetPlaceholderResourceRequest ¶
func GetPlaceholderResourceRequest(resources map[string]resource.Quantity) v1.ResourceList
func GetQueueNameFromPod ¶
func GetSchedulingPolicyParam ¶
func GetSchedulingPolicyParam(pod *v1.Pod) *interfaces.SchedulingPolicyParameters
func GetTaskGroupFromPodSpec ¶
func IsAssignedPod ¶
assignedPod selects pods that are assigned (scheduled and running).
func IsPodRunning ¶
func IsPodTerminated ¶
func MergeMaps ¶
merge two string maps if the same key defined in the first and second maps the value will be set by the second map
func NeedRecovery ¶
func NewK8sResourceList ¶
func NewK8sResourceList(resources ...K8sResource) map[v1.ResourceName]resource.Quantity
func NodeForTest ¶
func PodForTest ¶
func PodUnderCondition ¶
func PodUnderCondition(pod *v1.Pod, condition *v1.PodCondition) bool
compare the existing pod condition with the given one, return true if the pod condition remains not changed. return false if pod has no condition set yet, or condition has changed.
Types ¶
type K8sResource ¶
type K8sResource struct { ResourceName v1.ResourceName Value int64 }
type TaskGroupInstanceCountMap ¶
func NewTaskGroupInstanceCountMap ¶
func NewTaskGroupInstanceCountMap() *TaskGroupInstanceCountMap
func (*TaskGroupInstanceCountMap) Add ¶
func (t *TaskGroupInstanceCountMap) Add(taskGroupName string, num int32)
func (*TaskGroupInstanceCountMap) AddOne ¶
func (t *TaskGroupInstanceCountMap) AddOne(taskGroupName string)
func (*TaskGroupInstanceCountMap) DeleteOne ¶
func (t *TaskGroupInstanceCountMap) DeleteOne(taskGroupName string)
func (*TaskGroupInstanceCountMap) Equals ¶
func (t *TaskGroupInstanceCountMap) Equals(target *TaskGroupInstanceCountMap) bool
func (*TaskGroupInstanceCountMap) GetTaskGroupInstanceCount ¶
func (t *TaskGroupInstanceCountMap) GetTaskGroupInstanceCount(groupName string) int32
func (*TaskGroupInstanceCountMap) Size ¶
func (t *TaskGroupInstanceCountMap) Size() int
Click to show internal directories.
Click to hide internal directories.