zegl / kube-score

Kubernetes object analysis with recommendations for improved reliability and security. kube-score actively prevents downtime and bugs in your Kubernetes YAML and Charts. Static code analysis for Kubernetes.
https://kube-score.com
MIT License
2.74k stars 176 forks source link

score/apps: fix statefulset selector labels check #380

Closed euven closed 3 years ago

euven commented 3 years ago

Based on https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-selector

This fixes #336

RELNOTE: Add StatefulSet selector labels check
zegl commented 3 years ago

Hey! I left some comments about what the existing code is doing over in #336.

This PR seems to implement what is now #381 (and #382). I'd be happy to accept this PR if you reworked it so that it doesn't touch the StatefulSet has ServiceName test, which I suspect is working as it should, and is testing for a different thing than what is introduced in this PR:

euven commented 3 years ago

Hi @zegl - thanks for taking a look here :)

I had a read of your comment over at #336 and I think I get what you mean there - you're right, the current test there is correct and this should be supplementary.

I've re-worked the patch.

zegl commented 3 years ago

Thanks!

zegl commented 3 years ago

bors merge

bors[bot] commented 3 years ago

Build succeeded: