fix: createdAt should not be synced when update

This commit is contained in:
Qiu Jian
2020-02-08 21:29:06 +08:00
parent 8857a6281e
commit d912e29772
+6 -5
View File
@@ -2312,11 +2312,12 @@ func (self *SGuest) syncWithCloudVM(ctx context.Context, userCred mcclient.Token
self.ExpiredAt = extVM.GetExpiredAt()
}
if !recycle {
if createdAt := extVM.GetCreatedAt(); !createdAt.IsZero() {
self.CreatedAt = createdAt
}
}
// no need to sync CreatedAt
// if !recycle {
// if createdAt := extVM.GetCreatedAt(); !createdAt.IsZero() {
// self.CreatedAt = createdAt
// }
// }
return nil
})