Remove runtime-tools dependency#317
Conversation
8594a5b to
084a01f
Compare
|
@tianon-sso thanks for the work on #316. This here aims to reduce the diff by introducing a @klihub, this should also allow us to more easily switch back to |
084a01f to
3453086
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the dependency on opencontainers/runtime-tools by replacing generate.Generator usage with an internal OCI spec editor (internal/ociedit), while also incorporating the env cache keying fix and adding targeted tests to validate env/GID behavior and CDI-device collection.
Changes:
- Replaced
runtime-tools/generateusage in CDI spec mutation code paths withinternal/ociedit.SpecEditor. - Removed
runtime-tools(and related indirect deps) from module manifests and sums across the repo. - Added/extended tests covering env var replacement semantics, additional GID deduplication, and CDI-device extraction behavior.
Reviewed changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/cdi/container-edits.go |
Switches container edit application from runtime-tools generator to internal spec editor. |
internal/ociedit/spec_editor.go |
Introduces internal OCI spec mutation interface + native implementation (env/device/mount/hook/etc operations). |
pkg/cdi/container-edits_test.go |
Adds focused tests for env replacement ordering and AdditionalGIDs dedup behavior. |
cmd/cdi/cmd/cdi-api.go |
Replaces generator usage with internal editor when stripping CDI devices from an OCI spec. |
cmd/cdi/cmd/cdi-api_test.go |
Adds tests for CDI device collection/retention behavior. |
go.mod / go.sum |
Removes runtime-tools and related indirect dependencies from root module. |
schema/go.mod / schema/go.sum |
Removes runtime-tools and related indirect dependencies from schema module. |
cmd/cdi/go.mod / cmd/cdi/go.sum |
Updates cmd module dependencies after removing runtime-tools and adding needed test deps. |
cmd/validate/go.sum |
Removes runtime-tools-related sums from validate cmd module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
3453086 to
9c49c2b
Compare
| for _, val := range envs { | ||
| split := strings.SplitN(val, "=", 2) | ||
| e.addEnv(val, split[0]) | ||
| } |
| func (e *nativeSpecEditor) initConfig() { | ||
| if e.spec == nil { | ||
| e.spec = &oci.Spec{} | ||
| } | ||
| } |
Removes runtime-tools by replacing generator calls with an internal OCI spec editor. This allows us to also switch back to using a
Generatorfromruntime-tools/generateif we feel that this makes sense at some stage. Note that a similar interface is used in containerd/containerd#13519.Includes the env cache keying fix from opencontainers/runtime-tools#808 and focused tests.
Assisted by Codex