karmada/pkg/webhook
Mohamed Awnallah d5c9a9d803 pkg/webhook: test Multi-Cluster Service
In this commit, we introduce unit tests for both the `ValidationAdmission`
and `MutatingAdmission` webooks specifically for the `MultiClusterService` 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
    values in the `MultiClusterService` spec, ensuring error messaging.
  - Confirms that valid `MultiClusterService` objects are admitted without errors.

- Mutation webhook tests:
  - Handles decode errors and denies admission when decoding fails.
  - Provides full coverage of `MultiClusterService` object mutation,
    including setting default namespaces and validating no unnecessary patches.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-12 07:27:34 +03:00
..
clusteroverridepolicy Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
clusterpropagationpolicy pkg/webhook: log mutating webhook handlers 2024-09-11 07:53:16 +03:00
clusterresourcebinding Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
configuration Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
cronfederatedhpa Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
federatedhpa Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
federatedresourcequota pkg: test `federatedresourcequota` webhook 2024-08-01 02:39:44 +00:00
interpreter fix lint issues 2024-05-06 11:36:54 +08:00
multiclusteringress Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
multiclusterservice pkg/webhook: test Multi-Cluster Service 2024-09-12 07:27:34 +03:00
overridepolicy pkg/webhook: log mutating webhook handlers 2024-09-11 07:53:16 +03:00
propagationpolicy pkg/webhook: test PropagationPolicy 2024-09-10 06:39:20 +03:00
resourcebinding Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
resourcedeletionprotection pkg: test ResourceDeletionProtection valid webhook 2024-09-09 03:56:52 +03:00
resourceinterpretercustomization Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00
work Adopt controller-runtime braking changes: generics support PR2783 2024-07-13 16:49:01 +08:00