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

Pull hashingListSubtract() out of cdi_linux_test.go and into a pkg in util/ #1485

Closed
preminger opened this issue Mar 27, 2023 · 1 comment · Fixed by #1562
Closed

Pull hashingListSubtract() out of cdi_linux_test.go and into a pkg in util/ #1485

preminger opened this issue Mar 27, 2023 · 1 comment · Fixed by #1562
Assignees
Labels

Comments

@preminger
Copy link
Contributor

Type of issue
Technical debt

Description of issue
In the course of addressing #1394 (PR #1459), we added a utility function hashingListSubtract() in internal/pkg/runtime/launcher/oci/cdi_linux_test.go:253, which subtracts the contents of one array from another, building on capacities in https://github.com/samber/lo/ but capitalizing on the hashability of the array values to do so more efficiently than the prepackaged lo functions do.

This is a fairly general function, though, and so in principle, it doesn't belong buried in the particular unit-test for a particular pkg, and instead should be pulled out to a Singularity-wide location (e.g. under util).

What's currently blocking this, however, is that the function (as well as the lo code it depends on) uses generics, which in turn require Go 1.18 or later, and we're currently holding off on introducing Go 1.18+ dependencies outside of the testing suites.

@dtrudg
Copy link
Member

dtrudg commented Apr 11, 2023

Free to do this now - looking through the major distributions we are focused on (EL / SUSE / Ubuntu, everyone is at least at 1.18 now via a main or community repo package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment