fix: populate fsid for legacy NFS exports on migration
Migration 0002 added fsid column with DEFAULT 0 but never populated existing rows. Now PopulateLegacyFSIDs() runs after 0002 to extract fsid from legacy options string or generate random. Also: move generateRandomFSID to internal/system to avoid import cycles. Migration 0004 drops the legacy options column. Version: 0.3.1 -> 0.3.2
This commit is contained in:
@@ -3,6 +3,8 @@ package nfs
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/darroyo/nasctl/internal/system"
|
||||
)
|
||||
|
||||
func TestUniqueFSIDNoCollision(t *testing.T) {
|
||||
@@ -14,7 +16,7 @@ func TestUniqueFSIDNoCollision(t *testing.T) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
n, err := generateRandomFSID()
|
||||
n, err := system.GenerateRandomFSID()
|
||||
if err != nil {
|
||||
t.Errorf("generateRandomFSID failed: %v", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user