|
|
@ -2,6 +2,7 @@ package migrator
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
|
|
"github.com/portainer/portainer/api/bolt/errors"
|
|
|
|
"github.com/portainer/portainer/api/bolt/errors"
|
|
|
@ -167,6 +168,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error {
|
|
|
|
|
|
|
|
|
|
|
|
totalSnapshots := len(endpoint.Snapshots)
|
|
|
|
totalSnapshots := len(endpoint.Snapshots)
|
|
|
|
if totalSnapshots == 0 {
|
|
|
|
if totalSnapshots == 0 {
|
|
|
|
|
|
|
|
log.Println("[DEBUG] [volume migration] [message: no snapshot found]")
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -179,6 +181,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error {
|
|
|
|
|
|
|
|
|
|
|
|
if volumesData, done := snapshot.SnapshotRaw.Volumes.(map[string]interface{}); done {
|
|
|
|
if volumesData, done := snapshot.SnapshotRaw.Volumes.(map[string]interface{}); done {
|
|
|
|
if volumesData["Volumes"] == nil {
|
|
|
|
if volumesData["Volumes"] == nil {
|
|
|
|
|
|
|
|
log.Println("[DEBUG] [volume migration] [message: no volume data found]")
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -199,7 +202,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed deleting resource control %d: %w", resourceControl.ID, err)
|
|
|
|
return fmt.Errorf("failed deleting resource control %d: %w", resourceControl.ID, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Printf("[DEBUG] [volume migration] [message: legacy resource control(%s) has been deleted]", resourceControl.ResourceID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|