删除所有早于某个日期,在某个日期之前更新或应用程序版本低于此日期的版本 [英] Helm delete all release older than some date, updated before some date or if the app version is lower than

查看:51
本文介绍了删除所有早于某个日期,在某个日期之前更新或应用程序版本低于此日期的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除早于10月1日的发行版? 我的意思是在10月1日之前更新.
或者,删除应用程序版本低于_的所有发行版.

How can I delete release older than, for example, the 1st of October? I mean updated before the 1st of October.
Alternatively, delete all releases with the app version lower than _.

头盔ls输出:

|名称|版本|更新|状态|图表| APP版本|名称空间|
| myapp | 8 | 2019年9月27日星期五17:27:20 | DEPLOYED | myapp.85 | 85 |默认值|

|NAME|REVISION|UPDATED |STATUS |CHART |APP VERSION|NAMESPACE|
|myapp| 8 |Fri Sep 27 17:27:20 2019|DEPLOYED|myapp.85|85 |default|

以下命令仅删除一个.

helm delete relase_name

helm delete relase_name

以下方法也不是很好的解决方案

The following is not a great solution as well

helm delete relase_name1 relase_name2 relase_name3

helm delete relase_name1 relase_name2 relase_name3

注意1::我不想删除所有内容.在这里 Helm删除所有发行版,我对此没有任何解释.想要做到这一点.但是,我认为我需要为此任务使用bash.

Note1: I don't want to delete all. There is an explanation of how to do that over here Helm delete all releases and I don't want to do that. However, I assume I need to use bash for this task.

注意2::我已经阅读了文档,但并不大.过滤没有任何内容. https://helm.sh/docs/helm/#helm-delete

Note2: I have already read documentation it is not that big. There is nothing over there about filtering. https://helm.sh/docs/helm/#helm-delete

注3:我已经研究过头盔来源,我不确定100%,但是看起来 https://github.com/helm/helm/tree/master/pkg/helm

Note3: I have already looked into helm sources, I am not 100% sure but It doesn't look like it is possible https://github.com/helm/helm/tree/master/pkg/helm

提前谢谢!

推荐答案

下面的命令对我有用,虽然不是完美的解决方案,但至少对我有帮助:

The command bellow kind of worked for me, it is far from perfect solution but at least it helped me :

helm ls -d -m 25 --namespace default --short | xargs -L1 helm delete

helm ls -列出所有版本.
-d 按日期排序的订单.
-m 要获取的最大发行数量(所以我需要25个).
-默认的命名空间-在特定命名空间中显示发布,此选项有助于我过滤应用发布.
-short -此选项将命令的输出限制为仅释放名称.

helm ls - lists all of the releases.
-d orders by date.
-m maximum number of releases to fetch (so I take 25).
--namespace default - Show releases within a specific namespace, this option helped me to filter my app releases.
--short - this option limits output of the command to release names only.

该解决方案并不完美,我希望有人可以提供更好的解决方案.

The solution is not perfect and I hope that someone can provide a better solution.

这篇关于删除所有早于某个日期,在某个日期之前更新或应用程序版本低于此日期的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆