Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

长期使用后,物料包占用太多存储空间,希望增加自动清理功能,并支持自定义清理策略 #286

Closed
haixinhuang opened this issue Aug 26, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@haixinhuang
Copy link
Contributor

描述您的需求
在使用物料包管理插件一段时间之后,累积了大量的部署包,考虑长期持续使用的话,会导致存储成本增加,想要一个物料包清理的功能,支持配置多种清理策略,例如:
1.按部署的顺序清理(保留最近部署过的三个包)
2.按时间和是否部署过的标识来清理(清理三个月前上传的且未部署过的)

预期行为
物料包管理插件支持配置清理策略,能实现自动清理物料包,节省存储空间

描述您考虑过的替代方案
手工删除

附加

@haixinhuang haixinhuang added the enhancement New feature or request label Aug 26, 2021
@royl88
Copy link

royl88 commented Aug 26, 2021

实现方式如下:

  1. 获取CMDB的单元设计清单
  2. 根据单元设计获取对应的物料包清单,并按照更新时间降序排列
  3. 保留最新TopN个物料包(N 优先根据单元设计的保留个数字段获取,其次根据系统参数设置),其他物料包进行清理,并删除CMDB中的物料包记录
  4. 删除物料包记录(deleted_0)

PS:物料包发布后需要更新或确认物料包以更新"更新时间"字段信息

royl88 pushed a commit that referenced this issue Sep 8, 2021
@royl88
Copy link

royl88 commented Oct 22, 2021

v1.1.5已发布此特性

@royl88 royl88 closed this as completed Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants