openshift-client-tools - 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 集群上尝试过它工作正常。
该命令旨在在 bash 上运行,使用 oc.exe 是什么意思?
(我会发表评论,但我没有足够的声誉)。
推荐阅读
- python - Ajax POST 被 CORS 策略阻止
- javascript - ReactJS:一位数字输入可以以多个“0”结尾
- office-js - OfficeJS Outlook 邮件正文 getasync 为
标签
- java - 如何从 postgresql 中的存储过程中获取值到 java 应用程序中?我不断收到错误
- python - 如何从 BeautifuleSoup Python 创建的输出 CSV 文件中删除一种数据
- reactjs - 在 ReactJS 应用程序中下载文件,保留原始文件名
- android - Android 和自定义 URL 方案
- python - 斐波那契数列中的数学步骤
- java - 如何将 keycloak 短信验证器 jar 文件添加到 Keycloak?
- c++ - 从 Github 安装 C++ 库时遇到问题