New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inventory: sort the images based on the sorted tags and not in the hash #251
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cpanato The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@cpanato: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@cpanato I think the better answer is: treat the YAMLs as machine-readable data, and then use a separate tool to have different views of it (whether sorted by hash, tags, date, authorship, or whatever else). That is, we should encourage users to view the data through a tool (with different query options, etc) rather than reading the raw YAML. I've seen this pattern used in the https://www.ledger-cli.org/ tool in the world of accounting and I think we can adopt a similar approach. WDYT? |
@listx makes sense. thanks so much for the clarification. |
@cpanato: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Context:
We generate the image promotion for K/K artifacts and we notice the yaml file produced was something like
(can see the full file in this PR)
The Images are sorted by the hashes and @hasheddan came with the idea if we can sort that by the tags. Maybe is useful and this PR address that
Looking at the code when we are doing the sort the first step is to sort the tags because it can have multiple tags for the same hash. And then it sort the items by the hash.
the change here switch to sort by the tag, and since the tags is already sorted we take the first element in the tag array and use that to sort the items.
Applying that to the same PR that we did above we get
Which is now sorted by the tags.
Feel free to close this PR if that makes no sense.
/assign @listx @dims @tpepper
/cc @saschagrunert @hasheddan
thanks for the idea Daniel!