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

Method deleteTaskResults

workflow/controller/operator.go:844–858  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

842}
843
844func (woc *wfOperationCtx) deleteTaskResults(ctx context.Context) error {
845 deletePropagationBackground := metav1.DeletePropagationBackground
846 return woc.controller.wfclientset.ArgoprojV1alpha1().WorkflowTaskResults(woc.wf.Namespace).
847 DeleteCollection(
848 ctx,
849 metav1.DeleteOptions{PropagationPolicy: &deletePropagationBackground},
850 metav1.ListOptions{
851 LabelSelector: common.LabelKeyWorkflow + "=" + woc.wf.Name,
852 // DeleteCollection does a "list" operation to get the resources to delete, which by default does a strongly consistent read of the most recent version.
853 // This can be slow for Kubernetes versions before 1.34, so we set resourceVersion=0 to relax consistency and tell the k8s API to return any resource version.
854 // It's possible for this to miss some resources, but those should be GC'd when the parent workflow is deleted.
855 ResourceVersion: "0",
856 },
857 )
858}
859
860func (woc *wfOperationCtx) writeBackToInformer() error {
861 un, err := wfutil.ToUnstructured(woc.wf)

Callers 1

persistUpdatesMethod · 0.95

Calls 3

DeleteCollectionMethod · 0.65
WorkflowTaskResultsMethod · 0.65
ArgoprojV1alpha1Method · 0.65

Tested by

no test coverage detected