fix: Fix inconsistent ordering of workflows with the list command. #7594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7581
Hi, this PR fixes an issue where
argo list -o name
has inconsistent display order thanargo list
. The root cause is that we sort workflows based onCreationTimestamp
andFinishedAt
:argo-workflows/pkg/apis/workflow/v1alpha1/workflow_types.go
Lines 130 to 145 in f1fe3be
So we need to make sure these two fields are included in the name-only field selectors as well, in order to have a consistent sort.
Before
Workflows have inconsistent display order with / without
![Screenshot from 2022-01-19 23-39-28](https://user-images.githubusercontent.com/1311594/150274645-8078118a-1aab-46d7-b306-ebe02c8c74c0.png)
-o name
After
Workflows have consistent display order now
![Screenshot from 2022-01-19 23-40-00](https://user-images.githubusercontent.com/1311594/150274646-93efc06d-901d-4eca-b9f8-7e2c2efd72ad.png)
Thanks!
Signed-off-by: Peixuan Ding [email protected]