MCPcopy
hub / github.com/argoproj/argo-workflows / syncPodsInformer

Function syncPodsInformer

workflow/controller/controller_test.go:528–541  ·  view source on GitHub ↗
(ctx context.Context, woc *wfOperationCtx, podObjs ...apiv1.Pod)

Source from the content-addressed store, hash-verified

526}
527
528func syncPodsInformer(ctx context.Context, woc *wfOperationCtx, podObjs ...apiv1.Pod) {
529 podcs := woc.controller.kubeclientset.CoreV1().Pods(woc.wf.GetNamespace())
530 pods, err := podcs.List(ctx, metav1.ListOptions{})
531 if err != nil {
532 panic(err)
533 }
534 podObjs = append(podObjs, pods.Items...)
535 for _, pod := range podObjs {
536 err = woc.controller.PodController.TestingPodInformer().GetIndexer().Add(&pod)
537 if err != nil {
538 panic(err)
539 }
540 }
541}
542
543// makePodsPhase acts like a pod controller and simulates the transition of pods transitioning into a specified state
544func makePodsPhase(ctx context.Context, woc *wfOperationCtx, phase apiv1.PodPhase, with ...with) {

Callers 1

TestCountersFunction · 0.85

Calls 5

GetIndexerMethod · 0.80
TestingPodInformerMethod · 0.80
GetNamespaceMethod · 0.65
ListMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected