Skip to content
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

sortMounts stable and remove alphabetical order #241

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

Epsilon314
Copy link

PR for #240

@klihub klihub requested review from elezar, klihub and bart0sh November 13, 2024 14:51
Copy link
Contributor

@elezar elezar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Epsilon314

What is the expected behaviour when the mount being injected has:

  1. the same number of parts
  2. a greater number of parts

The behaviour for 1 seems undefined and was the motivation for the alphabetical sorting in the first place.

@Epsilon314
Copy link
Author

Epsilon314 commented Nov 15, 2024

@elezar For mounts with same number of parts, its original order will be kept (stable sort). Since containerd also uses stable sort, users can therefore arrange the order of their mounts (of same number of parts ) in container spec if they do need a specific order.

@elezar
Copy link
Contributor

elezar commented Nov 15, 2024

Ok, so if we add mounts these would always be added after the existing mounts. Could you add tests for those cases?

Signed-off-by: zhuyiqing.wiz <[email protected]>
@Epsilon314
Copy link
Author

Ok, so if we add mounts these would always be added after the existing mounts. Could you add tests for those cases?

@elezar OK

Copy link
Contributor

@elezar elezar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Epsilon314.

@klihub @bart0sh please take a look.

@bart0sh bart0sh merged commit 4149a8a into cncf-tags:main Nov 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants