Merge pull request #59137 from php-coder/improve_allow_priv_escalation_test
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
Move test cases to a proper test method
**What this PR does / why we need it**:
Prior this change, we had tests in `TestValidatePodSpec()` method that is designated for testing `ValidatePodSpec()`. But because we test code from the `ValidateSecurityContext()` method, the tests should belong to `TestValidateSecurityContext()`.
This PR improves the tests. Now the tests become less fragile because `ValidatePodSpec()` do a lot more validations than `ValidateSecurityContext()`.
**Which issue(s) this PR fixes**:
Related to https://github.com/kubernetes/kubernetes/pull/52803 where this code and tests were introduced.
**Release note**:
```release-note
NONE
```
PTAL @jessfraz
CC @simo5
Showing
Please
register
or
sign in
to comment