From c525dfd2c5c997035a356c9dcd7f27ddc9c60dc2 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Tue, 8 Feb 2022 16:18:59 +0800 Subject: [PATCH] fix(host): make tls-creds empty when no tls migrate --- pkg/hostman/guestman/guesttasks.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/hostman/guestman/guesttasks.go b/pkg/hostman/guestman/guesttasks.go index 12c35e373d..a8368b364e 100644 --- a/pkg/hostman/guestman/guesttasks.go +++ b/pkg/hostman/guestman/guesttasks.go @@ -682,7 +682,14 @@ func (s *SGuestLiveMigrateTask) startMigrate(res string) { }) }) } else { - s.doMigrate() + s.Monitor.MigrateSetParameter("tls-creds", "", func(res string) { + if strings.Contains(strings.ToLower(res), "error") { + s.migrateTask = nil + hostutils.TaskFailed(s.ctx, fmt.Sprintf("Migrate set tls-creds to empty error: %s", res)) + return + } + s.doMigrate() + }) } }