首页 > 解决方案 > Openshift: list unused secrets

问题描述

I have lots of secrets since last year and not sure which ones are in use by applications. Since I don't want to accidently delete in-use secret, I want to use oc.exe CLI and find all unused secrets. Somewhere I found the below cmd however it throws me an error:

for s in $(oc get secret --no-headers | awk '{print $1}'); do  echo $s; (oc get all -o yaml; oc describe sa )|grep $s |wc -l; done

Error: s was unexpected at this time.

标签: openshift-client-toolsopenshift-3openshift-enterprise

解决方案


我刚刚在我的 openshift 集群上尝试过它工作正常。

该命令旨在在 bash 上运行,使用 oc.exe 是什么意思?

(我会发表评论,但我没有足够的声誉)。


推荐阅读