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.72k stars 174 forks source link

Add checks for container ephemeral-storage resource request and limit #427

Closed kmarteaux closed 2 years ago

kmarteaux commented 2 years ago
RELNOTE: 
Implements _container-ephemeral-storage-requests-and-limits_ test to check pod containers have ephemeral-storage requests and limits set
zegl commented 2 years ago

Hey, thanks for contributing! This is looking really good, just some small tweaks:

1) Could we split the test so that the test for checking that the requirements equal the limits is in a separate (and optional) test. See score/container/container.go for how it's done for the other limits.

2) Could this code be moved to score/container? I like the structure where all tests are structured after the Type that it's testing.

Also, something is off with the test, it's setting the flag to test an optional test that doesn't seem to exist.

kmarteaux commented 2 years ago

Yes, no problem. I will make the suggested changes and resubmit.

kmarteaux commented 2 years ago

I'm going to close this PR, rebased my commits and then redo the PR.