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

Kubernetes v1.20 开始,K8s 默认删除了 metadata.selfLink #82

Open
neargle opened this issue Mar 13, 2023 · 1 comment
Open

Kubernetes v1.20 开始,K8s 默认删除了 metadata.selfLink #82

neargle opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@neargle
Copy link
Member

neargle commented Mar 13, 2023

历史上我们的几处代码里,有一个有趣但不算优雅的实现:使用 selfLink 来判断 Kubernetes ApiServer 的返回是否正确。

例如 CDK( github.com/cdk-team/CDK )里 检查 "selfLink": "/api/v1/namespaces/kube-system/pods/process-exporter-qnqwk" ;

但从 Kubernetes v1.20 开始,K8s 默认删除了 metadata.selfLink 字段,需要重启 apiserver 添加 RemoveSelfLink=false 才会有 selfLink。

我还在想有没有更优雅的方式来修复这个问题,毕竟漏洞测试工具要求被测环境修改启动参数是不可能的😂 。

@neargle neargle added the bug Something isn't working label Mar 13, 2023
@XDTG
Copy link

XDTG commented Mar 15, 2023

换成 resourceVersion 字段来判断?🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants