From 5752e74be6b1ac59c44e7b8a9e7ae18b6d94f80f Mon Sep 17 00:00:00 2001 From: Hui Date: Thu, 23 Sep 2021 09:12:35 +1200 Subject: [PATCH] add debug log (#5702) --- api/bolt/migrator/migrate_dbversion31.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/bolt/migrator/migrate_dbversion31.go b/api/bolt/migrator/migrate_dbversion31.go index c2c17eca5..8086dfc40 100644 --- a/api/bolt/migrator/migrate_dbversion31.go +++ b/api/bolt/migrator/migrate_dbversion31.go @@ -2,6 +2,7 @@ package migrator import ( "fmt" + "log" portainer "github.com/portainer/portainer/api" "github.com/portainer/portainer/api/bolt/errors" @@ -167,6 +168,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error { totalSnapshots := len(endpoint.Snapshots) if totalSnapshots == 0 { + log.Println("[DEBUG] [volume migration] [message: no snapshot found]") continue } @@ -179,6 +181,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error { if volumesData, done := snapshot.SnapshotRaw.Volumes.(map[string]interface{}); done { if volumesData["Volumes"] == nil { + log.Println("[DEBUG] [volume migration] [message: no volume data found]") continue } @@ -199,7 +202,7 @@ func (m *Migrator) updateVolumeResourceControlToDB32() error { if err != nil { 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) } }