karmada/pkg/webhook/clusteroverridepolicy
Mohamed Awnallah 5a2e714a3b pkg: test ClusterOverridePolicy validation webhook
In this commit, we add unit tests for the `ValidationAdmission`
webhook specifically for the `ClusterOverridePolicy` resource. These
tests ensure that the webhook correctly handles various admission
scenarios:

- Tests the behavior when decoding the request object fails, verifying
that the admission is denied with an approriate error message.
- Validates that the webhook denies admission when encountering invalid
label values in the `ClusterOverridePolicy` spec, ensuring proper error messaging.
- Confirms that valid `ClusterOverridePolicy` objects are admissionly allowed
without errors.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-09 03:26:49 +03:00
..
validating.go Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
validating_test.go pkg: test ClusterOverridePolicy validation webhook 2024-09-09 03:26:49 +03:00