argoproj / argo-workflows

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

Date/time in metadata.creationTimestamp and status.startedAt is the same when using archived workflows endpoint #11003

Open pieterlukasse opened 1 year ago

pieterlukasse commented 1 year ago

Pre-requisites

What happened/what you expected to happen?

I have a workflow that was pending for a while before it started (queue was full).

When I retrieve its details using the following endpoint https://localhost:2746/api/v1/archived-workflows/65af9a68-148c-4241-82f7-efb9e1edacc7?namespace=argo I get metadata.creationTimestamp != status.startedAt. This is expected.

However, when using the list endpoint https://localhost:2746/api/v1/archived-workflows?namespace=argo&listOptions.fieldSelector=spec.startedAt%3E2023-03-27T22:00:00.000Z,spec.startedAt%3C2023-04-28T22:00:00.000Z&listOptions.limit=10 I get metadata.creationTimestamp == status.startedAt. This is NOT expected.

Version

latest

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

Version details: {"version":"untagged",
"buildDate":"2023-04-28T02:12:04Z",
"gitCommit":"91f2a4548832d1a669ed2cc32623ead83013fc97","gitTag":"untagged",
"gitTreeState":"clean","goVersion":"go1.19.8","compiler":"gc","platform":"linux/arm64"}

Try submitting multiple dummy workflows until some get into "pending":

`argo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/artifact-passing.yaml`

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Not super relevant. The bug is clear.

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

Not super relevant. The bug is clear.
juliev0 commented 1 year ago

So, you're saying that the actual data for the Workflow that comes back from the call is incorrect? Can you post the responses to the two api calls?

pieterlukasse commented 1 year ago

@juliev0 yes, the response from the 2nd call is incorrect. As mentioned above:

For the first call I get metadata.creationTimestamp != status.startedAt. This is expected. For the 2nd call I get I get metadata.creationTimestamp == status.startedAt. This is NOT expected.

Are you not able to reproduce it?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

tooptoop4 commented 1 week ago

can close, https://github.com/argoproj/argo-workflows/blob/v3.4.7/persist/sqldb/workflow_archive.go#L181 was the issue but this was since fixed in https://github.com/argoproj/argo-workflows/pull/13136/files