mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(region): remove metadata (#14214)
This commit is contained in:
@@ -1726,6 +1726,12 @@ func DeleteModel(ctx context.Context, userCred mcclient.TokenCredential, item IM
|
||||
if userCred != nil {
|
||||
OpsLog.LogEvent(item, ACT_DELETE, item.GetShortDesc(ctx), userCred)
|
||||
}
|
||||
if _, ok := item.(IStandaloneModel); ok && len(item.GetId()) > 0 {
|
||||
err := Metadata.RemoveAll(ctx, item, userCred)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "Metadata.RemoveAll")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -585,17 +585,6 @@ func (model *SStandaloneAnonResourceBase) applyPolicyTags(ctx context.Context, u
|
||||
}
|
||||
}
|
||||
|
||||
func (model *SStandaloneAnonResourceBase) PostDelete(ctx context.Context, userCred mcclient.TokenCredential) {
|
||||
if model.Deleted {
|
||||
model.RemoveAllMetadata(ctx, userCred)
|
||||
}
|
||||
model.SResourceBase.PostDelete(ctx, userCred)
|
||||
}
|
||||
|
||||
// func (model *SStandaloneAnonResourceBase) Delete(ctx context.Context, userCred mcclient.TokenCredential) error {
|
||||
// return DeleteModel(ctx, userCred, model)
|
||||
// }
|
||||
|
||||
func (model *SStandaloneAnonResourceBase) ClearSchedDescCache() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user