Documentation
¶
Index ¶
- func CalculatePodRequests(pods []v1.Pod, resource v1.ResourceName) (int64, error)
- func ContainsString(slice []string, str string) bool
- func EvictPodWithGracePeriod(client clientset.Interface, pod *v1.Pod, gracePeriodSeconds int32) error
- func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
- func GetInt32withDefault(i *int32, value int32) int32
- func GetInt64withDefault(i *int64, value int64) int64
- func GetNodeRef(nodeName string) *v1.ObjectReference
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodsFromScale(kubeClient client.Client, scale *autoscalingapiv1.Scale) ([]v1.Pod, error)
- func GetScale(ctx context.Context, restMapper meta.RESTMapper, ...) (*autoscalingapiv1.Scale, *meta.RESTMapping, error)
- func GetUint32withDefault(i *uint32, value uint32) uint32
- func GetUint64FromMaps(key string, maps map[string]uint64) uint64
- func GetUint64withDefault(i *uint64, value uint64) uint64
- func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool
- func IsPodReady(pod *v1.Pod) bool
- func LabelSelectorMatched(maps map[string]string, selector *metav1.LabelSelector) (bool, error)
- func ParseDuration(s string) (time.Duration, error)
- func ParseFloat(str string, defaultValue float64) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePodRequests ¶
CalculatePodRequests sum request total from pods
func ContainsString ¶
func EvictPodWithGracePeriod ¶
func EvictPodWithGracePeriod(client clientset.Interface, pod *v1.Pod, gracePeriodSeconds int32) error
EvictPodWithGracePeriod evict pod with grace period
func GetAddressAndDialer ¶
func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
GetAddressAndDialer returns the address parsed from the given endpoint and a context dialer.
func GetInt32withDefault ¶
func GetInt64withDefault ¶
func GetNodeRef ¶
func GetNodeRef(nodeName string) *v1.ObjectReference
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition. copied from k8s.io/kubernetes/pkg/api/v1/pod.go
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present. copied from k8s.io/kubernetes/pkg/api/v1/pod.go
func GetPodsFromScale ¶
func GetScale ¶
func GetScale(ctx context.Context, restMapper meta.RESTMapper, scaleClient scale.ScalesGetter, namespace string, ref autoscalingv2.CrossVersionObjectReference) (*autoscalingapiv1.Scale, *meta.RESTMapping, error)
func GetUint32withDefault ¶
func GetUint64withDefault ¶
func IsPodAvailable ¶
IsPodAvailable returns true if a pod is available; false otherwise. copied from k8s.io/kubernetes/pkg/api/v1/pod.go
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise. copied from k8s.io/kubernetes/pkg/api/v1/pod.go
func LabelSelectorMatched ¶
func ParseDuration ¶
ParseDuration ParseDuration
Types ¶
This section is empty.