Validation and mutation logic of pod web-hooks is separated. Previously, validation and mutating logic were combined within a single function that was called twice. Now, only the required part is called and the results are passed to the API server. Tests were extended to follow the k8s behavior of applying mutations before running the actual validation of resources.
Checklist
Before submitting this PR, please make sure:
[x] you have added unit tests
[x] your code builds clean with make
[x] your code lets succeed unit tests with make test
Description
Validation and mutation logic of pod web-hooks is separated. Previously, validation and mutating logic were combined within a single function that was called twice. Now, only the required part is called and the results are passed to the API server. Tests were extended to follow the k8s behavior of applying mutations before running the actual validation of resources.
Checklist
Before submitting this PR, please make sure:
make
make test