update minimum go version to go1.23 and modernize some code - #354
Draft
thaJeztah wants to merge 9 commits into
Draft
update minimum go version to go1.23 and modernize some code#354thaJeztah wants to merge 9 commits into
thaJeztah wants to merge 9 commits into
Conversation
thaJeztah
force-pushed
the
cdi_cleans_step1
branch
from
August 24, 2026 09:10
aa2b990 to
d0c2aac
Compare
Add a matrix to run tests against the oldest supported version (as specified in go.mod), as well as current and previous stable Go. Use a custom name for the job so that the names are stable, which helps when configuring GitHub branch policies. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
InjectDevices only needs to hold the lock while refreshing the cache and capturing the current devices map. Release the lock before resolving devices to reduce lock contention while applying the container edits on the passed-in OCI spec. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is a constructor, working on a freshly created `Cache`, so there should be no concurrency to account for. While updating, also set the default specDirs directly from a clone of `DefaultSpecDirs`, instead of applying through `WithSpecDirs` to avoid the extra indirect. Paths are still cleaned, to account for the `DefaultSpecDirs` being a mutable, package-level variable (but generally not recommended to update). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Rename vars that shadowed imports, and make sure that the returned errors are properly dereferenced. Also append directory errors instead of overwriting existing errors for the same path. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Both slices.Clone and maps.Clone already handles `nil` values, so we can skip our own checks, making the code slightly more straightforward. Also update GetSpecDirErrors to make sure we perform the copy after obtaining a lock. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
cdi_cleans_step1
branch
from
August 24, 2026 12:31
d0c2aac to
685809d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
go.mod: update minimum go version to go1.23
pkg/cdi: simplify some code with slices, maps packages
Both slices.Clone and maps.Clone already handles
nilvalues, so we canskip our own checks, making the code slightly more straightforward.
Also update GetSpecDirErrors to make sure we perform the copy after
obtaining a lock.
pkg/cdi: ListClasses: combine loops
pkg/cdi: scope variables and move them closer to where used