Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeHash(template *corev1.PodTemplateSpec) string
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func GenStaticPodManifest(tmplSpec *corev1.PodTemplateSpec, hash string) (string, error)
- func Hyphen(str1, str2 string) string
- func NodeReadyByName(c client.Client, nodeName string) (bool, error)
- func SetPodUpgradeCondition(c client.Client, status corev1.ConditionStatus, pod *corev1.Pod) error
- func UnavailableCount(us *appsv1alpha1.YurtStaticSetUpgradeStrategy, numberToUpgrade int) (int, error)
- func WithConfigMapPrefix(str string) string
Constants ¶
const ( ConfigMapPrefix = "yurt-static-set-" // PodNeedUpgrade indicates whether the pod is able to upgrade. PodNeedUpgrade corev1.PodConditionType = "PodNeedUpgrade" StaticPodHashAnnotation = "openyurt.io/static-pod-hash" )
Variables ¶
var (
PodGVK = corev1.SchemeGroupVersion.WithKind("Pod")
)
Functions ¶
func ComputeHash ¶
func ComputeHash(template *corev1.PodTemplateSpec) string
ComputeHash returns a hash value calculated from pod template
func DeepHashObject ¶
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func GenStaticPodManifest ¶
func GenStaticPodManifest(tmplSpec *corev1.PodTemplateSpec, hash string) (string, error)
GenStaticPodManifest generates manifest from use-specified template
func NodeReadyByName ¶
NodeReadyByName check if the given node is ready
func SetPodUpgradeCondition ¶
SetPodUpgradeCondition set pod condition `PodNeedUpgrade` to the specified value
func UnavailableCount ¶
func UnavailableCount(us *appsv1alpha1.YurtStaticSetUpgradeStrategy, numberToUpgrade int) (int, error)
UnavailableCount returns 0 if unavailability is not requested, the expected unavailability number to allow out of numberToUpgrade if requested, or an error if the unavailability percentage requested is invalid.
func WithConfigMapPrefix ¶
WithConfigMapPrefix add prefix `yurt-static-set-` to the given string
Types ¶
This section is empty.