Commit Graph

5 Commits

Author SHA1 Message Date
changzhen 99c5bf4f22 fix ut failed in federatedresourcequota
Signed-off-by: changzhen <changzhen5@huawei.com>
2024-09-21 16:50:58 +08:00
Mohamed Awnallah fe408f9ad6 pkg/webhook: refactor Federated Resource Quota
In this commit, we refactor `FederatedResourceQuota` webhook
mainly matching on substrings instead of whole strings for reliability
and resilience and reformat the test case names to follow format
`Function_Scenario_ExpectedResult` for better readability.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-13 19:29:17 +03:00
Mohamed Awnallah 7373ab303e pkg: test `federatedresourcequota` webhook
In this commit, we add unit tests for the `FederatedResourceQuota`
validation logic and its related components. The tests ensure that
the validation logic correctly handles various scenarios, including:

- Validating `FederatedResourceQuota` specifications with appropriate resource assignments.
- Detecting cases where overall resource limits are less than the assigned resources.
- Handling scenarios where resource names in assignments do not exist in the overall resources.
- Validating `FederatedResourceQuotaStatus` to ensure standard resource types and correct cluster names.
- Handling invalid resource lists in both `Overall` and `AggregatedStatus`.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-08-01 02:39:44 +00:00
zhy76 adef1e5974 feat: add license and verify license for code file
Signed-off-by: zhy76 <958474674@qq.com>
2023-11-16 11:11:21 +08:00
changzhen 85ab6c7699 add ut for federatedresourcequota validating
Signed-off-by: changzhen <changzhen5@huawei.com>
2022-03-16 14:37:13 +08:00