utils

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PodGVK             = corev1.SchemeGroupVersion.WithKind("Pod")
	PVCGVK             = corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaim")
	CollaSetGVK        = appsv1alpha1.SchemeGroupVersion.WithKind("CollaSet")
	ResourceContextGVK = appsv1alpha1.SchemeGroupVersion.WithKind("ResourceContext")
)
View Source
var PodCodec = scheme.Codecs.LegacyCodec(corev1.SchemeGroupVersion)

Functions

func ApplyPatchFromRevision

func ApplyPatchFromRevision(pod *corev1.Pod, revision *appsv1.ControllerRevision) (*corev1.Pod, error)

func CollectPodInstanceID

func CollectPodInstanceID(pods []*PodWrapper) map[int]struct{}

func ComparePod

func ComparePod(l, r *corev1.Pod) bool

func ExtractPvcTmpName

func ExtractPvcTmpName(cls *appsv1alpha1.CollaSet, pvc *corev1.PersistentVolumeClaim) (string, error)

func GetPodFromRevision

func GetPodFromRevision(revision *appsv1.ControllerRevision) (*corev1.Pod, error)

func GetPodInstanceID

func GetPodInstanceID(pod *corev1.Pod) (int, error)

func GetPodRevisionPatch

func GetPodRevisionPatch(revision *appsv1.ControllerRevision) ([]byte, error)

func GetPodsPrefix

func GetPodsPrefix(controllerName string) string

func IsPodInactive added in v0.7.0

func IsPodInactive(pod *corev1.Pod) bool

func NewPodFrom

func NewPodFrom(owner metav1.Object, ownerRef *metav1.OwnerReference, revision *appsv1.ControllerRevision, instanceId string, updateFn ...func(*corev1.Pod) error) (*corev1.Pod, error)

func PatchToPod

func PatchToPod(currentRevisionObj, updateRevisionObj, currentObj client.Object) (client.Object, error)

PatchToPod Use three-way merge to get a updated pod.

func PodNamingSuffixPersistentSequence added in v0.7.0

func PodNamingSuffixPersistentSequence(cls *appsv1alpha1.CollaSet) bool

func PodReadyTime added in v0.7.0

func PodReadyTime(pod *corev1.Pod) *metav1.Time

func PvcTmpHash

func PvcTmpHash(pvc *corev1.PersistentVolumeClaim) (string, error)

func PvcTmpHashMapping

func PvcTmpHashMapping(pvcTmps []corev1.PersistentVolumeClaim) (map[string]string, error)

Types

type PodWrapper

type PodWrapper struct {
	*corev1.Pod
	ID            int
	ContextDetail *appsv1alpha1.ContextDetail

	PlaceHolder bool
	ToDelete    bool
	ToExclude   bool
}

Jump to

Keyboard shortcuts

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