Skip to content

Commit 6db77f6

Browse files
bart0shelezar
authored andcommitted
make specs-go a module
This should allow to import CDI spec structures without adding a lot of CDI runtime deps. It should partly fix #97 and allow Kubernetes to refer this module directly. There are at least 2 places in the k/k codebase that would benefit from this change: - this can be replaced by the specs-go import: https://github.com/kubernetes/kubernetes/blob/master/test/e2e/dra/test-driver/app/cdi.go - this can import specs-go and use JSON marshalling instead of quite ugly approach it uses to write CDI files: https://github.com/kubernetes/kubernetes/blob/master/test/images/sample-device-plugin/sampledeviceplugin.go#L237 Signed-off-by: Ed Bartosh <[email protected]>
1 parent 2cff845 commit 6db77f6

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

cmd/cdi/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
)
1313

1414
require (
15+
github.com/container-orchestrated-devices/container-device-interface/specs-go v0.0.0-00010101000000-000000000000 // indirect
1516
github.com/inconshreveable/mousetrap v1.0.1 // indirect
1617
github.com/opencontainers/selinux v1.10.0 // indirect
1718
github.com/spf13/pflag v1.0.5 // indirect
@@ -25,3 +26,5 @@ require (
2526
)
2627

2728
replace github.com/container-orchestrated-devices/container-device-interface => ../..
29+
30+
replace github.com/container-orchestrated-devices/container-device-interface/specs-go => ../../specs-go

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/container-orchestrated-devices/container-device-interface
33
go 1.19
44

55
require (
6+
github.com/container-orchestrated-devices/container-device-interface/specs-go v0.0.0-00010101000000-000000000000
67
github.com/fsnotify/fsnotify v1.5.1
78
github.com/opencontainers/runtime-spec v1.1.0
89
github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626
@@ -22,3 +23,5 @@ require (
2223
gopkg.in/yaml.v2 v2.4.0 // indirect
2324
gopkg.in/yaml.v3 v3.0.1 // indirect
2425
)
26+
27+
replace github.com/container-orchestrated-devices/container-device-interface/specs-go => ./specs-go

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9
1313
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
1414
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
1515
github.com/opencontainers/runtime-spec v1.0.3-0.20220825212826-86290f6a00fb/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
16+
github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
1617
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
1718
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
1819
github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 h1:DmNGcqH3WDbV5k8OJ+esPWbqUOX5rMLR2PMvziDMJi0=

specs-go/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/container-orchestrated-devices/container-device-interface/specs-go
2+
3+
go 1.19
4+
5+
require github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78

specs-go/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78 h1:R5M2qXZiK/mWPMT4VldCOiSL9HIAMuxQZWdG0CSM5+4=
2+
github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=

0 commit comments

Comments
 (0)