In this commit, we refactor propagation policy names and check
on number of patches the mutation happens.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
In this commit, we introduce unit tests for both the `ValidatingAdmission`
and `MutatingAdmission` webhooks for the `PropagationPolicy` resource.
The tests include:
- Validation webhook tests:
- Tests how the webhook responds when decoding the request object fails.
- Ensures that updates to the `SchedulerName` field are denied, as it should remain immutable.
- Validates that changes to the `PropagationPolicyPermanentIDLabel` label and its absence in creation requests are correctly handled.
- Confirms that valid `PropagationPolicy` objects are allowed through without errors.
- Mutation webhook tests:
- Handles decode errors and denies admission when decoding fails.
- Provides full coverage of policy mutation with default values and patch application.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>