Merge pull request #15170 from ioito/hotfix/qx-purge-vm-by-tags

fix(region): purge vm by tags
This commit is contained in:
Zexi Li
2022-10-13 09:45:12 +08:00
committed by GitHub
+2 -2
View File
@@ -2487,8 +2487,8 @@ func (self *SHost) SyncHostVMs(ctx context.Context, userCred mcclient.TokenCrede
for i := 0; i < len(commondb); i += 1 {
skip, key := skipFunc(commonext[i])
if skip {
log.Infof("skip server %s(%s) sync for delete with system tag key: %s", commonext[i].GetName(), commonext[i].GetGlobalId(), key)
err := commondb[i].syncRemoveCloudVM(ctx, userCred)
log.Infof("delete server %s(%s) with system tag key: %s", commonext[i].GetName(), commonext[i].GetGlobalId(), key)
err := commondb[i].purge(ctx, userCred)
if err != nil {
syncResult.DeleteError(err)
continue