package validation

import (
	"strings"

	corev1 "k8s.io/api/core/v1"
)

func BuildHolderPodName(normalPodName string) string {
	return holderPodNamePrefix + normalPodName
}

func GetNormalPodName(holderPodName string) string {
	return strings.TrimPrefix(holderPodName, holderPodNamePrefix)
}

func HasPeerHolderPod(pod *corev1.Pod) bool {
	_, ok := pod.Annotations[maxReplicasAnnotationKey]
	return ok
}

func IsHolderPod(pod *corev1.Pod) bool {
	return pod.Labels[holderPodLabelKey] == holderPodLabelValue
}
