In this commit, we introduce unit tests for both the `ValidationAdmission`
and `MutatingAdmission` webhooks specifically for the `OverridePolicy` resource.
- Validation webhook tests:
- Tests the behavior when decoding the request object fails, verifying
that admission is denied with an appropriate error message.
- Validates that the webhook denies admission when encountering invalid
label values in the `OverridePolicy` spec, ensuring proper error messaging.
- Confirms that valid `OverridePolicy` objects are admitted without errors.
- Mutation webhook tests:
- Handles decode errors and denies admission when decoding fails.
- Provides full coverage of policy mutation, including setting default
namespaces and validating no unnecessary patches.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
In this commit, we log the mutating handlers for `OverridePolicy`,
`ClusterPropagationPolicy`, and `MultiClusterService`. Specifically, it logs
information about the mutation of these resources, including the namespace,
name, and the operation type from the admission request.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>