Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,22 @@ func ValidateRoStore(path string) error {
return nil
}

// Validate that at least Podman-overlay Store subdirectories are present
requiredSubdirs := []string{"overlay", "overlay-images", "overlay-layers"}
for _, dir := range requiredSubdirs {
// Accept any of the common podman-overlay store subdirs is present
hasSubdirs := false
storeSubdirs := []string{"overlay", "overlay-images", "overlay-layers"}
for _, dir := range storeSubdirs {
fullPath := filepath.Join(path, dir)
if err := IsDir(fullPath); err != nil {
return fmt.Errorf("storage validation failed: %w", err)
if _, err := os.Stat(fullPath); err == nil {
// We found a subdir, we can break loop
hasSubdirs = true
break
}
}
if !hasSubdirs {
return fmt.Errorf("storage validation failed, non-empty and does not look like a podman-overlay store")
}

// Good enough check, dir looks like a podman overlay store
return nil
}