argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.11k stars 3.21k forks source link

fix: ignore pod started time when incorrectly set to epoch. Fixes #13709 #13710

Open AntoineDao opened 1 month ago

AntoineDao commented 1 month ago

Fixes #13709

Motivation

We have observed that containerd somtimes fails a pod on GKE and sets the startedAt value to "1970-01-01T00:00:00Z" which causes argo workflows to calculate invalid resources duration.

Modifications

Added a check for resources duration function that will set the cpu and memory values to 0 if the container startedAt time being equal to "1970-01-01T00:00:00Z".

Verification

I have added a unit test for the existing functionality (calculating resources durations) and a unit test for the added functionality (setting value to 0 if started at is 1970).