File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
2424 "github.com/spf13/cobra"
2525
2626 "tags.cncf.io/container-device-interface/pkg/cdi"
27+ "tags.cncf.io/container-device-interface/specs-go"
2728)
2829
2930// validateCmd is our CDI command for validating CDI Spec files in the cache.
@@ -49,6 +50,15 @@ were reported by the cache.`,
4950 fmt .Printf (" %2d: %v\n " , idx , strings .TrimSpace (err .Error ()))
5051 }
5152 }
53+
54+ for _ , v := range cache .ListVendors () {
55+ for _ , s := range cache .GetVendorSpecs (v ) {
56+ if err := specs .ValidateVersion (s .Spec ); err != nil {
57+ fmt .Printf ("Spec file %s failed version validation: %v\n " , s .GetPath (), err )
58+ }
59+ }
60+ }
61+
5262 os .Exit (1 )
5363 },
5464}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require (
1111 sigs.k8s.io/yaml v1.4.0
1212 tags.cncf.io/container-device-interface v1.0.1
1313 tags.cncf.io/container-device-interface/schema v0.0.0
14+ tags.cncf.io/container-device-interface/specs-go v1.0.0
1415)
1516
1617require (
@@ -22,7 +23,6 @@ require (
2223 github.com/xeipuuv/gojsonschema v1.2.0 // indirect
2324 golang.org/x/mod v0.19.0 // indirect
2425 golang.org/x/sys v0.19.0 // indirect
25- tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
2626)
2727
2828replace (
You can’t perform that action at this time.
0 commit comments