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 (
2323	"github.com/spf13/cobra" 
2424
2525	"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" 
2628)
2729
2830var  (
@@ -58,14 +60,17 @@ func init() {
5860}
5961
6062func  initSpecDirs () {
61- 	err  :=  cdi . SetSchema (schemaName )
63+ 	s ,  err  :=  schema . Load (schemaName )
6264	if  err  !=  nil  {
6365		fmt .Printf ("failed to load JSON schema %s: %v\n " , schemaName , err )
6466		os .Exit (1 )
6567	}
68+ 	cdi .SetSpecValidator (validate .WithSchema (s ))
6669
6770	if  len (specDirs ) >  0  {
68- 		cdi .GetRegistry (cdi .WithSpecDirs (specDirs ... ))
71+ 		cdi .GetRegistry (
72+ 			cdi .WithSpecDirs (specDirs ... ),
73+ 		)
6974		if  len (cdi .GetRegistry ().GetErrors ()) >  0  {
7075			cdiPrintRegistryErrors ()
7176		}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments