File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -134,18 +134,17 @@ func (cfg *Config) Validate() error {
134
134
return fmt .Errorf ("failed to stat kernel image path, %q: %v" , cfg .KernelImagePath , err )
135
135
}
136
136
137
- rootPath := ""
138
137
for _ , drive := range cfg .Drives {
139
138
if BoolValue (drive .IsRootDevice ) {
140
- rootPath = StringValue (drive .PathOnHost )
139
+ rootPath := StringValue (drive .PathOnHost )
140
+ if _ , err := os .Stat (rootPath ); err != nil {
141
+ return fmt .Errorf ("failed to stat host path, %q: %v" , rootPath , err )
142
+ }
143
+
141
144
break
142
145
}
143
146
}
144
147
145
- if _ , err := os .Stat (rootPath ); err != nil {
146
- return fmt .Errorf ("failed to stat host path, %q: %v" , rootPath , err )
147
- }
148
-
149
148
// Check the non-existence of some files:
150
149
if _ , err := os .Stat (cfg .SocketPath ); err == nil {
151
150
return fmt .Errorf ("socket %s already exists" , cfg .SocketPath )
You can’t perform that action at this time.
0 commit comments