File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ import (
23
23
"github.com/spf13/cobra"
24
24
25
25
"github.com/container-orchestrated-devices/container-device-interface/pkg/cdi"
26
+ "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/validate"
27
+ "github.com/container-orchestrated-devices/container-device-interface/schema"
26
28
)
27
29
28
30
var (
@@ -58,14 +60,17 @@ func init() {
58
60
}
59
61
60
62
func initSpecDirs () {
61
- err := cdi . SetSchema (schemaName )
63
+ s , err := schema . Load (schemaName )
62
64
if err != nil {
63
65
fmt .Printf ("failed to load JSON schema %s: %v\n " , schemaName , err )
64
66
os .Exit (1 )
65
67
}
68
+ cdi .SetSpecValidator (validate .WithSchema (s ))
66
69
67
70
if len (specDirs ) > 0 {
68
- cdi .GetRegistry (cdi .WithSpecDirs (specDirs ... ))
71
+ cdi .GetRegistry (
72
+ cdi .WithSpecDirs (specDirs ... ),
73
+ )
69
74
if len (cdi .GetRegistry ().GetErrors ()) > 0 {
70
75
cdiPrintRegistryErrors ()
71
76
}
You can’t perform that action at this time.
0 commit comments