karmada/pkg
Mohamed Awnallah f19f9c4a45 pkg/webhook: test OverridePolicy
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>
2024-09-13 10:14:04 +03:00
..
aggregatedapiserver Merge pull request #4254 from chaunceyjiang/cluster_proxy 2023-11-22 20:21:52 +08:00
apis work suspension: work status conditions 2024-08-07 22:25:05 -04:00
clusterdiscovery/clusterapi feat: add license and verify license for code file 2023-11-16 11:11:21 +08:00
controllers Fix spelling errors 2024-08-29 15:58:05 +08:00
dependenciesdistributor Improved test coverage for dependencies_distributor in pkg/dependenciesdistributor 2024-08-29 12:49:20 +05:30
descheduler skip descheduling ResourceBinding which is being deleted 2024-08-28 17:05:03 +08:00
detector Merge pull request #5413 from NishantBansal2003/unit-test-detector 2024-08-27 09:35:44 +08:00
estimator Added unit tests for service in pkg/estimator/client 2024-08-27 12:02:02 +05:30
events work suspension: emit event for work dispatch status 2024-08-09 06:15:05 -04:00
features [MVP] add resourcequota plugin in scheduler-estimator: add resourcequota plugin 2024-01-27 15:27:47 +08:00
generated Bump custom-metrics-server to v1.30.0 which requires Kubernetes v1.30 as the main module 2024-08-28 15:23:06 +08:00
karmadactl feat: Added 's' shorthand to operation-scope flags 2024-09-04 16:52:46 -04:00
metrics add metrics for recreate/update resource event when sync work status 2024-07-26 11:17:48 +08:00
metricsadapter Call shutdown after being stopped 2024-05-14 18:01:02 +08:00
modeling resourceModels supports extended resources 2023-11-23 19:08:32 +08:00
printers Add more columns for cluster 2024-07-10 14:25:33 +08:00
registry fix: aggregate apiserver http method to get 2024-08-29 17:59:12 +08:00
resourceinterpreter Fix spelling errors 2024-08-29 15:58:05 +08:00
scheduler refactor 2024-08-21 22:28:42 +05:30
search fix code inspection errors 2024-06-12 17:55:59 +08:00
servicenameresolutiondetector Added tests for pkg/servicenameresolutiondetector 2024-08-23 10:24:10 +05:30
sharedcli bump golangci to v1.58.0 2024-05-13 09:32:13 +08:00
util Merge pull request #5029 from XiShanYongYe-Chang/remove-pp-name-length-limit 2024-08-31 11:28:48 +08:00
version bump golangci to v1.58.0 2024-05-13 09:32:13 +08:00
webhook pkg/webhook: test OverridePolicy 2024-09-13 10:14:04 +03:00