Commit Graph

3371 Commits

Author SHA1 Message Date
zhzhuang-zju 26103ecdff Standardize the naming conventions for karmada system roles
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-11-19 19:06:28 +08:00
karmada-bot a53c8bc5ef
Merge pull request #5779 from ctripcloud/work-index
Add index for work
2024-11-19 12:41:56 +08:00
karmada-bot e0d77eb330
Merge pull request #5826 from RainbowMango/pr_update_purge_mode
Update application failover purge mode comments
2024-11-19 11:50:57 +08:00
zach593 e2827b1b2e Add index for Work to speed up the processing of resource binding related controllers
Signed-off-by: zach593 <zach_li@outlook.com>
2024-11-19 11:48:04 +08:00
karmada-bot 993fa26c49
Merge pull request #5828 from anujagrawal699/addedTests-pkg/resourceinterpreter/default/native/reflectstatus.go
Added unit tests for reflect status interpreter
2024-11-18 17:00:55 +08:00
karmada-bot 09ceced40b
Merge pull request #5822 from anujagrawal699/addedTests-pkg/estimator/client/general.go
Added unit tests for general estimator package
2024-11-18 15:09:55 +08:00
Anuj Agrawal 59f266cd0c Added unit tests for pkg/resourceinterpreter/default/native/reflectstatus.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-17 20:52:11 +05:30
karmada-bot 35a82371b2
Merge pull request #5821 from XiShanYongYe-Chang/update-GracefulEvictCluster-to-set-purgemode
Support PurgeMode setting in evection tasks
2024-11-16 16:27:53 +08:00
RainbowMango d0497d41ce Update application failover purge mode comments
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-11-16 15:32:28 +08:00
Anuj Agrawal 310e4f989b Added unit tests for status and cronfederatedhpa helper utilities
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added unit tests for status and cronfederatedhpa helper utilities

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added unit tests for status and cronfederatedhpa helper utilities

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added unit tests for status and cronfederatedhpa helper utilities

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-16 12:37:10 +05:30
Anuj Agrawal 1cd78d6258 Added unit tests for general estimator package
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-15 21:54:20 +05:30
karmada-bot 3acc14c0f0
Merge pull request #5810 from mohamedawnallah/unitTestKarmadaSearchController
pkg/search: unit test controller
2024-11-15 17:37:53 +08:00
karmada-bot e7fd4eb847
Merge pull request #5493 from anujagrawal699/addedTests-pkg/controllers/deploymentreplicassyncer
Added tests for controllers/deploymentreplicassyncer
2024-11-15 14:38:53 +08:00
Anuj Agrawal 455cb3928b Added tests for controllers/deploymentreplicassyncer
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/deploymentreplicassyncer

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/deploymentreplicassyncer

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/deploymentreplicassyncer

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/deploymentreplicassyncer

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/deploymentreplicassyncer

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-15 11:04:53 +05:30
changzhen db7982e9a9 update GracefulEvictCluster() to set PurgeMode during eviction process
Signed-off-by: changzhen <changzhen5@huawei.com>
2024-11-15 12:02:17 +08:00
karmada-bot 35b7e8f120
Merge pull request #5816 from mszacillo/purgemode-api
feat(stateful failover support) Introduce PurgeMode to GracefulEvictionTask in ResourceBinding
2024-11-15 09:50:52 +08:00
karmada-bot 0d7d2f92d2
Merge pull request #5807 from RainbowMango/pr_bump_k8s_v1312
Bump Kubernetes dependencies from v1.30.2 to v1.31.2
2024-11-15 09:20:52 +08:00
Anuj Agrawal efff5bca9d Added unit tests for safe lua lifted libraries
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-14 22:49:29 +05:30
mszacillo 9b92cc4d51 Introduce PurgeMode to GracefulEvictionTask in ResourceBinding
Signed-off-by: mszacillo <mszacillo@bloomberg.net>
2024-11-14 10:21:56 -05:00
karmada-bot 6f138cfc8d
Merge pull request #5801 from SataQiu/fieldSelector
karmada-search: support field selector for corev1 resources
2024-11-14 09:44:51 +08:00
SataQiu c9e6ce5387 karmada-search: support field selector for corev1 resources
Signed-off-by: SataQiu <shidaqiu2018@gmail.com>
2024-11-13 21:48:43 +08:00
Mohamed Awnallah dc2eea8710 pkg/search: unit test controller
In this commit, we unit test karmada search controller
on creating new controller and handling the following events
watched by the shared informer: `addCluster`, `updateCluster`,
`deleteCluster`, `addResourceRegistry`, `updateResourceRegistry`,
and `deleteResourceRegistry` making sure those handled and cached
correctly to the indexer.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-13 01:33:34 +02:00
RainbowMango fc1df776dc Adopt controller-runtime braking change: TypedReconciler
Reference PR2799
Adopt Kubernetes#125483 introduced ReadinessCheck
Adopt Kubernetes breaking change: EffectiveVersion
Reference PR: 122891

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-11-12 17:52:46 +08:00
RainbowMango c2de90bb5e Bump Kubernetes dependencies to v1.31.2
Bump controller-runtime to v0.19.1

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-11-12 17:52:36 +08:00
chang.qiangqiang 066eec0b7d feat(dependenciesdistributor): introduced flag for dependencies-distributor
Signed-off-by: chang.qiangqiang <chang.qiangqiang@immomo.com>
2024-11-12 16:31:21 +08:00
karmada-bot 046d1ba107
Merge pull request #5798 from anujagrawal699/addedTests-pkg/util/helper/workstatus.go
Added unit tests for pkg/util/helper/workstatus.go
2024-11-12 11:53:50 +08:00
Anuj Agrawal ed50e02d4e Added unit tests for pkg/util/helper/workstatus.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added unit tests for pkg/util/helper/workstatus.go

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-11 20:30:50 +05:30
changzhen 41ba3c769d cancel concurrent test for SetupWithManager
Signed-off-by: changzhen <changzhen5@huawei.com>
2024-11-11 19:57:50 +08:00
karmada-bot ed3f48cd32
Merge pull request #5799 from chaosi-zju/ctrl-name
Ensure controller names are unique when emitting metrics
2024-11-11 15:37:49 +08:00
karmada-bot c69408879d
Merge pull request #5786 from mohamedawnallah/unitTestKarmadaInitCheck
pkg/karmadactl/cmdinit/karmada: unit test check
2024-11-11 14:56:49 +08:00
chaosi-zju b605d9d637 ensure controller names are unique when emitting metrics
Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
2024-11-11 12:05:12 +08:00
karmada-bot d8b58c4f74
Merge pull request #5770 from anujagrawal699/addedTests-pkg/util/lifted/scheduler/cache/snapshot_test.go
Added unit tests for the scheduler cache snapshot functionality
2024-11-11 11:35:49 +08:00
karmada-bot b5c6660f53
Merge pull request #5795 from mohamedawnallah/unitTestKarmadaSearchAPIServer
pkg/search: unit test karmada search APIServer
2024-11-11 10:40:49 +08:00
karmada-bot 41582f87d5
Merge pull request #5792 from anujagrawal699/addedTests-pkg/util/lifted/scheduler/cache/cache.go
Added unit tests for scheduler's cache package
2024-11-08 17:57:47 +08:00
Anuj Agrawal 085b433f49 Added unit tests for scheduler's cache package
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added unit tests for scheduler's cache package

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-07 09:43:57 +05:30
karmada-bot 0cc294f998
Merge pull request #5759 from mohamedawnallah/unitTestTLSBootstrapAgent
pkg/karmadactl/cmdinit: unit test bootstraptoken
2024-11-07 09:56:46 +08:00
chang.qiangqiang 2daa150fd6 fix(status): set log to level 5
Signed-off-by: chang.qiangqiang <chang.qiangqiang@immomo.com>
2024-11-06 16:28:42 +08:00
Mohamed Awnallah c059c68f9b pkg/search: unit test karmada search APIServer
In this commit, we unit test karmada search APIServer
on creating REST storage and installing the API group.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-06 01:15:31 +02:00
Mohamed Awnallah 0a56741bb6 pkg/karmadactl/cmdinit: unit test bootstraptoken
In this commit, we unit test bootstraptoken agent on tlsbootstrap
functionality by testing `AllowBootstrapTokensToPostCSRs`,
`AutoApproveKarmadaAgentBootstrapTokens`, and `AutoApproveAgentCertificateRotation`
making sure they are working as expected.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-05 16:51:08 +02:00
Mohamed Awnallah 91c4f92702 pkg/karmadactl/addons: unit test karmada search
In this commit, we unit test karmada search on status operation.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-05 15:53:25 +02:00
karmada-bot a935aa1a76
Merge pull request #5610 from yanfeng1992/fixbug-toomany-conn
cluster proxy transport disable keepalive
2024-11-05 16:38:44 +08:00
karmada-bot ac589d6921
Merge pull request #5765 from mohamedawnallah/unitTestDeschedulerAddon
pkg/karmadactl/addons: unit test descheduler
2024-11-05 09:41:43 +08:00
Mohamed Awnallah c636d16948 pkg/karmadactl: unit test check in cmdinit
In this commit, we unit test `WaitAPIServiceReady` check function
that is utilized across addons and during init operations on waiting
for a non-existent aaAPIService, not-ready aaAPIService, and finally
where aaAPIService becomes ready before the timeout.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-04 21:46:07 +02:00
karmada-bot 8c7607e741
Merge pull request #5778 from mohamedawnallah/unitTestAggregatedAPIServer
pkg: unit test aggregatedAPIServer
2024-11-04 18:16:43 +08:00
karmada-bot e90ff63b6f
Merge pull request #5780 from ctripcloud/crb-status-ut
fix crb_status_controller ut is referencing namespaced objects
2024-11-04 14:23:43 +08:00
karmada-bot 6f2f3ebb22
Merge pull request #4451 from zhzhuang-zju/unjoin
Enhanced forced deletion on karmadactl unjoin
2024-11-04 11:15:43 +08:00
zhzhuang-zju 1eb2f9ec31 enhanced forced deletion on karmadactl unjoin
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-11-04 09:59:11 +08:00
zach593 0e64e7ed05 fix crb_status_controller ut is referencing namespaced objects
Signed-off-by: zach593 <zach_li@outlook.com>
2024-11-03 17:34:28 +08:00
Mohamed Awnallah ccccace553 pkg: unit test aggregatedAPIServer
In this commit, we unit test aggregatedAPIServer on creating
new aggregatedAPIServer with clusterAPI.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-11-02 18:22:52 +02:00
Anuj Agrawal 8ea31a8d5c Added unit tests for the scheduler cache snapshot functionality
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-11-01 15:44:13 +05:30
Mohamed Awnallah ddf4102d18 pkg/karmadactl/addons: unit test descheduler
In this commit, we unit test descheduler addon on enabling,
disabling, and status operations. In addition to this we refactor
some code to utilize some utilities across karmadactl addons.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-31 22:26:51 +03:00
Mohamed Awnallah 3b79f574c0 pkg/karmadactl/addons: unit test metrics adapter
In this commit, we unit test metrics adapter on status
operations making sure metrics adapter deployed correctly
on both the host cluster and karmada control plane by checking
on deployment and aaAPIServices respectively.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-30 14:51:01 +03:00
karmada-bot 9c0bd72aad
Merge pull request #5751 from anujagrawal699/addedTests-pkg/util/lifted/scheduler/framework/types.go
Added unit tests for scheduler framework types
2024-10-30 14:45:39 +08:00
Mohamed Awnallah 4ab6bff3b0 pkg/karmadactl/addons: unit test install addons
In this commit, we unit test install addons to make sure the
following addons `karmada-descheduler`, `karmada-metrics-adapter`,
`karmada-scheduler-estimator`, and `karmada-search` are already
configured.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-29 15:43:17 +03:00
wulemao 83a23abbd5 add related ut for unregister
Signed-off-by: wulemao <1194736083@qq.com>
2024-10-29 18:31:16 +08:00
karmada-bot 6c6281f6a4
Merge pull request #5594 from wulemao/karmadactl-unjoin
cleanup: change *kubeclient.Clientset to kubeclient.Interface in unregister module
2024-10-29 17:32:39 +08:00
karmada-bot 9421792640
Merge pull request #5620 from ipsum-0320/Implement-group-score-calc-test
Add unit test for group score calc to assign replicas evenly
2024-10-29 16:48:39 +08:00
ipsum-0320 a41892b66e feat: add UT for group score calc
Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: add UT for group score calc

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: add UT for group score calc

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: add unit test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: fix lint

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: update the calc way of group score

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

re-test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: update comment

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: re-test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: update weightUnit

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

Trigger checks

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: lint error

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: update the calc of group score

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: golint error

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: complete unit test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: add test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>
2024-10-29 15:55:17 +08:00
wulemao e0017b6ba4 cleanup: change *kubeclient.Clientset to kubeclient.Interface in unregister module
Signed-off-by: wulemao <1194736083@qq.com>
2024-10-29 15:32:12 +08:00
karmada-bot 07c6cb4db9
Merge pull request #5306 from tiansuo114/config
Add GitHub tests for karmadactl init --config command
2024-10-29 14:41:38 +08:00
tiansuo114 7426b4144b
Add github ci test for karmadactl init --init-config
Signed-off-by: tiansuo114 <1729765480@qq.com>
2024-10-29 11:00:24 +08:00
karmada-bot 5432d3260e
Merge pull request #5622 from ipsum-0320/Implement-group-score-calc-bonus
Implement calc group score for duplicate to assign replicas evenly
2024-10-29 10:23:38 +08:00
karmada-bot 1e333650dd
Merge pull request #5626 from wulemao/karmadactl-unregister
support unregister cluster in karmada
2024-10-28 21:20:38 +08:00
wulemao f803efe492 support unregister cluster in karmada
Signed-off-by: wulemao <1194736083@qq.com>
2024-10-28 20:25:28 +08:00
ipsum-0320 9e349e60a8 feat: implement calc group score for duplicate to assign replicas evenly
Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: implement calc group score for duplicate to assign replicas evenly

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: calc group score for duplicate to assign replicas evenly

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>
2024-10-28 19:20:39 +08:00
Anuj Agrawal 4f160e297d Added unit tests for scheduler framework types
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-28 15:59:21 +05:30
Amir Alavi 1a7409d815
chore: unify karmada labels/annotations usage in execution controller and test
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-10-26 14:06:04 -04:00
karmada-bot 1cd75f4fd0
Merge pull request #5621 from ipsum-0320/Implement-group-score-calc-base
Implement calc group score for divided to assign replicas evenly
2024-10-26 18:26:36 +08:00
ipsum-0320 aa8cbda942 feat: calc group score by weight
Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: update

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

re-test

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: update basic score

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: add comment

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: calcGroupScoreForDivided

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: lint error

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

chore: fix the comment

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

feat: resolve the comments

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>

fix: lint error

Signed-off-by: ipsum-0320 <trueman.0320@zju.edu.cn>
2024-10-26 14:11:33 +08:00
tiansuo114 9b9847e3f7
Feature: karmadactl init supports deployment through configuration files
Signed-off-by: tiansuo114 <1729765480@qq.com>

fix lint

Signed-off-by: tiansuo114 <1729765480@qq.com>
2024-10-25 17:02:59 +08:00
Anuj Agrawal da6266028e Added tests for pkg/util/helper/work.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for pkg/util/helper/work.go

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-25 13:11:31 +05:30
chaunceyjiang 38bb553266 feat: set conflictResolution for dependent resources.
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
2024-10-25 15:15:14 +08:00
karmada-bot 53c00f72f2
Merge pull request #5711 from anujagrawal699/addedTests-pkg/detector-part1
Added first part of unit tests for pkg/detector
2024-10-25 14:14:35 +08:00
karmada-bot c6c20a9e22
Merge pull request #5733 from anujagrawal699/addedTests-pkg/util/round_trippers.go-context.go-policy-go
Added tests for utility functions in the pkg/util
2024-10-24 19:19:34 +08:00
karmada-bot 7347f11ebb
Merge pull request #5717 from XiShanYongYe-Chang/handle-preserveResource-with-dependency
Keep preserveResourcesOnDeletion of the dependent resource consistent with that of the primary resource
2024-10-24 12:21:33 +08:00
Anuj Agrawal d35b21e786 Added tests for utility functions in the pkg/util
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-23 17:38:57 +05:30
karmada-bot 331145f789
Merge pull request #5700 from anujagrawal699/addedTest-pkg/util/lifted/corev1printers.go-part2
Added second part of unit tests for pkg/util/lifted/corev1printers.go
2024-10-23 15:04:32 +08:00
Anuj Agrawal 012517d81e Added first part of unit tests for pkg/detector
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added first part of unit tests for pkg/detector

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-23 12:24:26 +05:30
karmada-bot 4d0181c2b9
Merge pull request #5706 from RainbowMango/pr_fix_incorrect_grade_choice
Fixes incorrect resource model selection
2024-10-23 14:52:32 +08:00
karmada-bot f19a4b5281
Merge pull request #5543 from anujagrawal699/addedTests-controllers/gracefuleviction
Added tests for graceful eviction controller
2024-10-23 10:45:32 +08:00
changzhen f63c134aa4 handle preserveResourceOnDeletion with dependencise distributor
Signed-off-by: changzhen <changzhen5@huawei.com>
2024-10-23 10:25:31 +08:00
karmada-bot be571fbe8e
Merge pull request #5662 from yanfeng1992/fix-search-match-resource
hasResource should return whether resource is matched not cached
2024-10-22 10:47:32 +08:00
LivingCcj 3a4464aa00 add ResourceSummary deep copy in general-estimator
Signed-off-by: LivingCcj <livingccj@163.com>
2024-10-21 19:33:37 +08:00
karmada-bot e316db3a48
Merge pull request #5481 from anujagrawal699/addedTests-pkg/controllers/cronfederatedhpa
Added tests for cronfederatedhpa controller
2024-10-21 11:03:31 +08:00
RainbowMango a6679ddec0 Fixes an issue where resource model grades were incorrectly matched based on resource requests. Now only grades that can provide sufficient resources will be selected.
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-10-19 18:07:22 +08:00
karmada-bot fdc47f8688
Merge pull request #5472 from zhzhuang-zju/dial
karmada-scheduler-estimator add the support for custom DNS suffix
2024-10-19 16:16:29 +08:00
karmada-bot 4294e60704
Merge pull request #5561 from mohamedawnallah/validateKeyAndHandleErrors
operator/pkg/certs: validate X509 Cert key types and improve error handling
2024-10-19 15:19:29 +08:00
wei-chenglai 5b48832496 Fix InterpreterOperationAll description typo
Signed-off-by: wei-chenglai <qazwsx0939059006@gmail.com>
2024-10-18 23:10:39 -04:00
Mohamed Awnallah ad7a70b008 operator/pkg/certs: validate key types and val err
In this commit, we enhance the `GeneratePrivateKey` and `ParsePrivateKeyPEM` functions:

- Added validation for unsupported key types and provided a more descriptive error message.
This function supports ECDSA (using P-256) and RSA (with a key size of 3072 bits) algorithms.
It returns an error for unsupported key types.
- Improved error handling to include the type of the unsupported key format in the error message.
This function now provides more informative feedback when the private key format is neither RSA nor ECDSA.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-18 15:48:34 +03:00
karmada-bot 29c97e9848
Merge pull request #5602 from mohamedawnallah/dependOnAggregatorInterface
operator/pkg: depend on `aggregator.Interface` instead of `*aggregator.Clientset`
2024-10-17 11:58:28 +08:00
Anuj Agrawal 35b92e4c1b Added second part of unit tests for pkg/util/lifted/corev1printers.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-16 20:53:53 +05:30
karmada-bot 19b32a2979
Merge pull request #5597 from a7i/amir/preserveResourcesOnDeletion
implement preserveResourcesOnDeletion to support migration rollback
2024-10-16 18:19:27 +08:00
karmada-bot 4db886790f
Merge pull request #5681 from anujagrawal699/part2-addedTests-pkg/scheduler/scheduler.go
Added second part of unit tests for pkg/scheduler
2024-10-16 15:51:27 +08:00
karmada-bot 0d520c0490
Merge pull request #5695 from anujagrawal699/addedTest-pkg/util/lifted/corev1printers.go-part1
Added first part of unit tests for pkg/util/lifted/corev1printers.go
2024-10-16 15:49:27 +08:00
Anuj Agrawal b98dc6e950 Added tests for pkg/util/membercluster_client_test.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for pkg/util/membercluster_client_test.go

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-15 22:58:00 +05:30
Anuj Agrawal 261cbdb70b Added second part of unit tests for pkg/scheduler
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added second part of unit tests for pkg/scheduler

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added second part of unit tests for pkg/scheduler

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-15 14:59:46 +05:30
karmada-bot bf771c7a8a
Merge pull request #5680 from anujagrawal699/part1-addedTests-pkg/scheduler/scheduler.go
Added first part of unit tests for pkg/scheduler
2024-10-15 12:09:26 +08:00
Amir Alavi 68c0104bc4
remove labels and annotation from resources
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-10-14 22:49:59 -04:00
Amir Alavi 866959a072
implement preserveResourcesOnDeletion to support migration rollback
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-10-14 20:36:53 -04:00
Anuj Agrawal ace0e69099 Added first part of unit tests for pkg/util/lifted/corev1printers.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-14 22:12:15 +05:30
huangyanfeng e7b6513db0 HasResource should return whether resource is registered not cached
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
2024-10-14 17:21:25 +08:00
Anuj Agrawal 0d6d2d732e Added first part of unit tests for pkg/scheduler
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added first part of unit tests for pkg/scheduler

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-14 13:01:27 +05:30
karmada-bot d8b1889321
Merge pull request #5682 from anujagrawal699/addedTests-pkg/util/lifted/podtemplate.go
Added unit tests for pkg/util/lifted/podtemplate.go
2024-10-14 11:59:25 +08:00
karmada-bot e117edcfc3
Merge pull request #5684 from anujagrawal699/addedTests-pkg/util/lifted/-validateclustertaints.go-validatingmcs.go
Added tests for validateclustertaints.go and validatingmcs.go
2024-10-14 10:59:25 +08:00
LavredisG 8df8c0f3db
Update interface.go
Signed-off-by: LavredisG <lavredisgoume@gmail.com>
2024-10-13 12:41:50 +03:00
Anuj Agrawal b30b04fa4b Added tests for pkg/util/lifted/validateclustertaints.go and validatingmcs.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-12 18:34:30 +05:30
Anuj Agrawal 5124c2d164 Added unit tests for pkg/util/lifted/podtemplate.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-12 17:20:11 +05:30
karmada-bot 839737dc1b
Merge pull request #5644 from anujagrawal699/addedTests-scheduler/metrics-scheduler/framework
Added tests for metrics and framework package of pkg/scheduler
2024-10-12 10:54:23 +08:00
karmada-bot b52775f926
Merge pull request #5671 from chaunceyjiang/fieldoverrider_validate
feat: validate fieldOverrider operation
2024-10-12 10:10:23 +08:00
karmada-bot d295576a5e
Merge pull request #5646 from anujagrawal699/addedTests-pkg/scheduler/core/common.go
Added tests pkg/scheduler/core/common.go
2024-10-11 18:28:23 +08:00
Anuj Agrawal 5dc2355172 Added tests for pkg/scheduler/core/common.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for pkg/scheduler/core/common.go

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-11 15:04:47 +05:30
chaunceyjiang f45aedb716 feat: validate fieldOverrider operation
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
2024-10-11 14:59:04 +08:00
RainbowMango e9e3c62db8 Update file line terminators to LF
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-10-11 11:05:13 +08:00
karmada-bot 5dd4ab80ad
Merge pull request #5663 from anujagrawal699/addedTests-pkg/util/lifted/validatingfhpa.go
Added unit tests for FederatedHPA validation
2024-10-10 20:21:22 +08:00
karmada-bot 4a77d619fe
Merge pull request #5649 from anujagrawal699/addedTests-pkg/descheduler/core
Added new tests and refractored old in pkg/descheduler/core
2024-10-10 17:57:21 +08:00
karmada-bot f32780f9f8
Merge pull request #5637 from anujagrawal699/addedTests-pkg/scheduler/cache
Added tests for scheduler/cache
2024-10-10 17:27:23 +08:00
Anuj Agrawal e9f4e7a6ca Added unit tests for FederatedHPA validation
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-10 13:55:15 +05:30
Anuj Agrawal 4a0fb95945 Added tests for scheduler/cache
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for pkg/scheduler/cache

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-10 08:19:55 +05:30
zhzhuang-zju 08026dc483 skip cleanup when the poliy claim metadata changed
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-10-10 10:39:59 +08:00
karmada-bot 11d5c971fe
Merge pull request #5563 from zhzhuang-zju/preemption
Clean up the residual annotations when resources are preempted by pp from cpp
2024-10-09 12:13:20 +08:00
karmada-bot 376d20376c
Merge pull request #5542 from mohamedawnallah/unitTestInterpreter
pkg/webhook: unit test Interpreter
2024-10-09 11:52:20 +08:00
karmada-bot 33cb56d9de
Merge pull request #5642 from anujagrawal699/addedTests-pkg/scheduler/framework/plugins
Added tests for scheduler plugins
2024-10-09 11:32:20 +08:00
karmada-bot c5a5c84323
Merge pull request #5653 from anujagrawal699/addedTests-pkg/descheduler/descheduler.go
Added tests for pkg/descheduler/descheduler.go
2024-10-09 10:49:21 +08:00
zhzhuang-zju 69a07ed3a0 Clean up the residual annotations when resources are preempted by pp from cpp
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-10-09 10:37:09 +08:00
Mohamed Awnallah c571cfb39a pkg/webhook: test Interpreter
In this commit, we introduce unit tests for the `Interpreter` webhook
across `Decoder`, `HTTP`, `Injection`, `Response`, and `Webhook` components.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-09 05:26:27 +03:00
karmada-bot c6f3de1ce9
Merge pull request #5641 from anujagrawal699/addedTests-pkg/scheduler/event_handler.go
Added tests for pkg/scheduler/event_handler.go
2024-10-09 09:48:20 +08:00
Anuj Agrawal c493e04c6f Added tests for pkg/descheduler/descheduler.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-08 21:37:48 +05:30
sophie 6bf6f305b8 feat: add fieldoverrider
Signed-off-by: sophie <yl5357@columbia.edu>
2024-10-08 10:36:32 -04:00
Anuj Agrawal fc8b905aaa Added new tests and refractored old in pkg/descheduler/core
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-07 20:33:29 +05:30
Anuj Agrawal 39d3ef3b11 Added tests for metrics and framework package of pkg/scheduler
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-05 21:11:32 +05:30
Amir Alavi dbed85441a
skip interpret health of resources without a hook
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-10-05 11:09:52 -04:00
Anuj Agrawal e818659bb2 Added tests for scheduler/framework/plugins
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for scheduler/framework/plugins

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-05 00:34:00 +05:30
Anuj Agrawal 1b177e5fe6 Added tests for pkg/scheduler/event_handler.go
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-10-04 17:07:26 +05:30
Julian Lawrence 902bb1bbc9 fix sts pvc logic
Co-authored-by: yelshall <youssuf.elshall@zendesk.com>
Signed-off-by: Julian Lawrence <julianlawrence@gmail.com>
2024-10-02 19:45:23 -07:00
karmada-bot 59e302558d
Merge pull request #5616 from mohamedawnallah/dependOnClientSetInterface
operator+pkg:  depend on `clientset.Interface` instead of `*clientset.Clientset`
2024-09-29 15:11:12 +08:00
Mohamed Awnallah a640f0969f operator+pkg: depend on clientset.Interface for DI
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-27 15:35:40 +03:00
Mohamed Awnallah 6c490dcefa operator: depend on aggregator.Interface for DI
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-27 15:16:25 +03:00
karmada-bot 58612d3624
Merge pull request #5606 from anujagrawal699/addedTests-controllers/workloadrebalancer
Improved test coverage for workloadrebalancer controller
2024-09-27 15:12:10 +08:00
karmada-bot e4c6f54c7a
Merge pull request #5612 from wangxf1987/fix/improve-log
Show more debug logs when failed to build resource model due to `getIndex` fails
2024-09-27 14:56:11 +08:00
Anuj Agrawal 9bb8b5b0df Improved test coverage for workloadrebalancer controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Changed the resource to clusterrole

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for workloadrebalancer controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-27 11:43:03 +05:30
wangxiaofei67 8762d280b1 fix: when the "getIndex" fails, display more data details in logs.
Signed-off-by: wangxiaofei67 <wangxiaofei67@jd.com>

fix: add signoff

Signed-off-by: wangxiaofei67 <wangxiaofei67@jd.com>

fix: optimize prompt messages in the logs
2024-09-27 13:59:59 +08:00
karmada-bot 087d9ea52a
Merge pull request #5601 from wulemao/karmadactl-promote
guarantee the promotion can be rolled back safely
2024-09-27 12:20:10 +08:00
RainbowMango 6b3a781491 Correct SuspendDispatching comments and add notes.
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-09-26 16:50:12 +08:00
huangyanfeng 122ff3a07c cluster proxy transport disable keepalive
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
2024-09-26 14:49:15 +08:00
karmada-bot 8039769a71
Merge pull request #5595 from anujagrawal699/addedTests-controllers/remediation
Added tests for remediation controller
2024-09-26 10:36:09 +08:00
wulemao 7f082af21a guarantee the promotion can be rolled back safely
Signed-off-by: wulemao <1194736083@qq.com>
2024-09-26 10:24:19 +08:00
karmada-bot 879ead91a8
Merge pull request #5600 from anujagrawal699/addedTests-controllers/unifiedauth
Added tests for unifiedauth controller
2024-09-25 11:50:09 +08:00
Anuj Agrawal 32ae2178c2 Added tests for unifiedauth controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-24 22:12:23 +05:30
Anuj Agrawal 270819a779 Added tests for remediation controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-23 20:45:01 +05:30
RainbowMango 8ad4b5a989 Proposing structured field overrider API
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-09-23 20:37:44 +08:00
karmada-bot 721107da86
Merge pull request #5507 from mohamedawnallah/unitTestFederatedHPAWebhook
pkg/webhook: unit test Federated HPA
2024-09-23 17:40:07 +08:00
karmada-bot 12cd43ef42
Merge pull request #5589 from anujagrawal699/addedTests-controllers/multiclusterservice
Added tests for multiclusterservice controller
2024-09-23 16:01:07 +08:00
karmada-bot a70551ad92
Merge pull request #5575 from RainbowMango/pr_propose_preserve_api
Proposing API to support migration rollback
2024-09-23 15:42:07 +08:00
karmada-bot 9f23d2961d
Merge pull request #5552 from chaosi-zju/bind-descheduler
Remove deprecated --bind-address and --secure-port from karmada-descheduler
2024-09-23 14:47:07 +08:00
karmada-bot 9864a29684
Merge pull request #5580 from XiShanYongYe-Chang/fix-ut-failed-in-federatedresourcequota
fix ut failed in federatedresourcequota
2024-09-23 12:13:07 +08:00
karmada-bot d7f7b96eb1
Merge pull request #5551 from chaosi-zju/bind-scheduler
Remove deprecated --bind-address and --secure-port from karmada-scheduler
2024-09-23 11:51:07 +08:00
Anuj Agrawal b7b508b599 Added tests for multiclusterservice controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-22 20:47:48 +05:30
karmada-bot 2d95f7cbc7
Merge pull request #5498 from mohamedawnallah/unitTestClusterResourceBindingWebhook
pkg/webhook: unit test cluster resource binding
2024-09-21 18:53:06 +08:00
karmada-bot 673a603fb5
Merge pull request #5497 from mohamedawnallah/unitTestResourceBindingWebhook
pkg/webhook: unit test resource binding
2024-09-21 17:51:06 +08:00
karmada-bot b630d14544
Merge pull request #5496 from mohamedawnallah/unitTestClusterOverridePolicy
pkg/webhook: unit test cluster override policy
2024-09-21 17:29:06 +08:00
karmada-bot 6804af4d04
Merge pull request #5495 from mohamedawnallah/unitTestOverridePolicy
pkg/webhook: unit test override policy
2024-09-21 17:09:06 +08:00
changzhen 99c5bf4f22 fix ut failed in federatedresourcequota
Signed-off-by: changzhen <changzhen5@huawei.com>
2024-09-21 16:50:58 +08:00
karmada-bot 6c484ca2ec
Merge pull request #5518 from mohamedawnallah/unitTestMultiClusterIngress
pkg/webhook: unit test Multi-Cluster Ingress
2024-09-21 14:35:06 +08:00
chaosi-zju 6edb9cee1e Remove deprecated --bind-address and --secure-port from karmada-descheduler
Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
2024-09-21 10:59:24 +08:00
karmada-bot 21c18eb132
Merge pull request #5544 from mohamedawnallah/refactorFederatedResourceQuota
pkg/webhook: refactor Federated Resource Quota test
2024-09-21 10:40:05 +08:00
RainbowMango aa61791ccb Proposing preserve API to support migration sceanrios
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-09-20 18:26:53 +08:00
chaosi-zju 03023103d6 Remove deprecated --bind-address and --secure-port from karmada-scheduler
Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
2024-09-20 18:10:37 +08:00
karmada-bot b8edec1ef6
Merge pull request #5533 from zhzhuang-zju/autocompletion
Implementing autocompletion for karmadactl
2024-09-20 10:35:05 +08:00
zhzhuang-zju a684edd354 Implementing autocompletion for karmadactl
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-09-20 09:42:40 +08:00
karmada-bot 836b8789d7
Merge pull request #5562 from mohamedawnallah/unitTestResourceInterpreterCustomization
pkg/webhook: unit test ResourceInterpreterCustomization
2024-09-20 09:32:05 +08:00
karmada-bot e97f2bb113
Merge pull request #5555 from seanlaii/remove-parameter-scheduler-estimator
Remove deprecated `--bind-address` and `--bind-address` from `karmada-scheduler-estimator`
2024-09-19 18:58:04 +08:00
Anuj Agrawal 547a6a94bc Added tests for gracefuleviction controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for gracefuleviction contoller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-19 13:12:14 +05:30
huangyanfeng 4c416cec6f Skip cluster removal if already scheduled and API enablements are incomplete to prevent accidental removal.
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
2024-09-18 14:23:00 +08:00
Mohamed Awnallah 466634ac3d pkg/webhook: test ResourceInterpreterCustomization
In this commit, we introduce unit tests for `ValidationAdmission`
webhook for the `ResourceInterpreterCustomization` resource. The
tests include:

- Tests how the webhook responds when decoding the request object fails.
- Tests how the webhook responds when it fails to retrieve list of objects from a namespace.
- Ensures that invalid `ResourceInterpreterCustomization` spec denies the admission.
- Confirms that valid `ResourceInterpreterCustomization` spec are allowed through without errors.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-16 16:17:13 +03:00
wei-chenglai a72b72ba93 Remove BindAddress & SecurePort of karmada-scheduler-estimator
Signed-off-by: wei-chenglai <qazwsx0939059006@gmail.com>
2024-09-16 00:03:38 -04:00
Mohamed Awnallah d2259d52a1 pkg/webhook: test Multi-Cluster Ingress
In this commit we introduce unit tests for the `Validation Admission`. These
tests ensure correct behavior for various validation scenarios and improve coverage:

- 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
  `MultiClusterIngress` spec, ensuring error messaging.
- Confirms that valid `MultiClusterIngress` objects are admitted without errors.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-14 13:13:49 +03:00
karmada-bot e76ce6355b
Merge pull request #5400 from whitewindmills/apienablement-condition
add new cluster condition: CompleteAPIEnablements
2024-09-14 09:39:00 +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
whitewindmills 3307a52627 add new cluster condition: IncompleteAPIEnablements
Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
2024-09-13 17:40:24 +08:00
karmada-bot 2e60a6e8a5
Merge pull request #5494 from mohamedawnallah/unitTestClusterPropagationPolicy
pkg/webhook: unit test cluster propagation policy
2024-09-13 16:36:59 +08:00
karmada-bot c3d582ba31
Merge pull request #5537 from mohamedawnallah/refactorPropagationPolicyTest
pkg/webhook: refactor Propagation Policy test
2024-09-13 16:10:59 +08:00
Mohamed Awnallah 14c303022d pkg: test ClusterResourceBinding mutating webhook
In this commit, we introduce unit tests for the `MutatingAdmission`
webhook that mutates the `ClusterResourceBinding` resource. These tests
ensure correct behavior for various mutation scenarios and improve coverage:

- Testing the handling of decode errors and ensuring that admission is denied
when decoding fails.
- Full coverage testing of policy mutation, including setting default UUID
labels for the `ClusterResourceBinding`.
- Verifying that only the expected patch for the UUID label is applied, ensuring
no other unnecessary mutations.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-13 10:27:01 +03:00
Mohamed Awnallah e689eafd3f pkg: test ResourceBinding mutating webhook
In this commit, we introduce unit tests for the `MutatingAdmission`
webhook that mutates the `ResourceBinding` resource. These tests ensure
correct behavior for various mutation scenarios and improve coverage:

- Testing the handling of decode errors and ensuring that admission
is denied when decoding fails.
- Full coverage testing of policy mutation, including setting default
UUID labels for the `ResourceBinding`.
- Verifying that only the expected patch for the UUID label is applied,
ensuring no other unnecessary mutations.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-13 10:21:05 +03:00
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
Mohamed Awnallah 87958641ae pkg/webhook: test ClusterPropagationPolicy
In this commit, we introduce unit tests for both the `ValidatingAdmission`
and `MutatingAdmission` webhooks for the `ClusterPropagationPolicy` resource.

The tests include:

- Validation webhook tests:
  - Tests how the webhook responds when decoding the request object fails.
  - Ensures updates to the `SchedulerName` field are denied, as it should remain immutable.
  - Validates that changes to the `ClusterPropagationPolicyPermanentIDLabel` label and its absence in creation requests are correctly handled.
  - Confirms that valid `ClusterPropagationPolicy` objects are allowed through without errors.

- Mutation webhook tests:
  - Handles decode errors and denies admission when decoding fails.
  - Provides full coverage of cluster policy mutation with default values and patch application.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-13 10:08:43 +03:00
Mohamed Awnallah 368b4b171d pkg/webhook: refactor propagation policy
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>
2024-09-13 09:56:50 +03:00
Anuj Agrawal 6bbbf9d8ae Added tests for federatedresourcequota controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for federatedresourcequota controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-13 09:58:36 +05:30
Xinzhao Xu 19c0b4cbfa Remove me from resourceinterpreter OWNERS
Signed-off-by: Xinzhao Xu <z2d@jifangcheng.com>
2024-09-12 16:38:37 +08:00
karmada-bot 02e5e922e9
Merge pull request #5517 from mohamedawnallah/unitTestMultiClusterService
pkg/webhook: unit test Multi-Cluster Service
2024-09-12 15:58:59 +08:00
Mohamed Awnallah bd847422af pkg/webhook: test Work
In this commit, we introduce unit tests for the `MutatingAdmission`
webhook specifically for the `Work` resource. The mutation webhook
tests include the following:

- Handles decode errors and denies admission when decoding fails.
- Provides full coverage of policy mutation, including setting default
  and validating no unnecessary patches.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-12 07:28:03 +03:00
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
karmada-bot 671372acb2
Merge pull request #5528 from anujagrawal699/addedTests-controllers/federatedhpa
Added tests for federatedhpa controller
2024-09-12 12:14:58 +08:00
karmada-bot 927dc33d58
Merge pull request #5521 from mohamedawnallah/logMutatingWebhookHandlers
pkg/webhook: log mutating handlers in `OverridePolicy`, `ClusterPropagationPolicy`, and `MultiClusterService`
2024-09-12 10:47:58 +08:00
Anuj Agrawal 337f787963 Added tests for federatedhpa controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for federatedhpa controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-11 19:37:49 +05:30
chaosi-zju e7db9d74b0 remove redundant launch arguments when install estimator by karmadactl
Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
2024-09-11 16:59:28 +08:00
zhzhuang-zju 4dfb1efe0c karmada-scheduler-estimator add the support for custom DNS suffix
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-09-11 14:14:07 +08:00
Mohamed Awnallah df270fab91 pkg/webhook: log mutating webhook handlers
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>
2024-09-11 07:53:16 +03:00
karmada-bot 4ac95b95a1
Merge pull request #5508 from mohamedawnallah/unifyUsingPolicyV1Alpha1Operators
pkg+test: unify the usage of policyv1alpha1 operators
2024-09-11 12:05:57 +08:00
Lan Liang 0395765962 Update karmada-apiserve and kube-controller-manager to v1.30.4 by default.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-09-10 13:59:13 +00:00
karmada-bot 07e297681c
Merge pull request #5478 from jabellard/estimator_service_namespace
Add the Ability to Specify the Namespace Used for Discovering Scheduler Estimator Services
2024-09-10 19:41:56 +08:00
karmada-bot ca1b2ce3c7
Merge pull request #5492 from mohamedawnallah/unitTestPropagationPolicy
pkg/webhook: unit test propagation policy
2024-09-10 14:13:56 +08:00
karmada-bot 2577b5f63e
Merge pull request #5499 from mohamedawnallah/unitTestResourceDeletionProtectionWebhook
pkg/webhook: unit test resource deletion protection
2024-09-10 11:44:56 +08:00
Mohamed Awnallah e2a3f5942c pkg/webhook: test PropagationPolicy
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>
2024-09-10 06:39:20 +03:00
karmada-bot aaae246280
Merge pull request #5487 from zhzhuang-zju/namespace
fix: command create cannot specify the namespace
2024-09-10 11:32:56 +08:00
karmada-bot 4668cf0808
Merge pull request #5321 from tiansuo114/node
Support multiple label selection ability in EtcdNodeSelectorLabels
2024-09-10 11:07:57 +08:00
zhzhuang-zju 4a2dc3d935 fix: command create cannot specify the namespace
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-09-10 10:23:09 +08:00
Mohamed Awnallah be87fd5e71 pkg+test: unify usage of policyv1alpha1 operators
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-09 22:56:47 +03:00
Mohamed Awnallah e5169f8889 pkg/webhook: test FederatedHPA
In this commit, we introduce unit tests for both the `MutatingAdmission`
and `ValidatingAdmission` webhooks specifically for the `FederatedHPA`
resource.

The tests include:

- Validation webhook tests:
  - Verifies that admission is denied with an appropriate error message
    when decoding the request object fails.
  - Ensures admission is denied when the `FederatedHPA` spec contains
    invalid values, such as a `minReplicas` set to zero, and the correct
    error message is returned.
  - Confirms that a valid `FederatedHPA` object is allowed through without
    errors.

- Mutation webhook tests:
  - Verifies that admission is denied when decoding the request object
    fails, returning the appropriate error message.
  - Ensures that the `FederatedHPA` object is correctly mutated when
    provided with default values, including scale policies and CPU
    utilization.
  - Confirms that no patches are applied when the `FederatedHPA` object is
    handled correctly and that admission is allowed for valid
    `FederatedHPA` objects.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-09 15:51:02 +03:00
karmada-bot 54b90a2ff2
Merge pull request #5467 from xovoxy/cluster-ut
add test for pkg/controllers/cluster
2024-09-09 20:21:56 +08:00
tiansuo114 2c57ebae0e
Support multiple label selection ability in EtcdNodeSelectorLabels
Signed-off-by: tiansuo114 <1729765480@qq.com>

fix ci

Signed-off-by: tiansuo114 <1729765480@qq.com>

add unit test

Signed-off-by: tiansuo114 <1729765480@qq.com>

change unit test

Signed-off-by: tiansuo114 <1729765480@qq.com>

rm mapsEqual

Signed-off-by: tiansuo114 <1729765480@qq.com>

fix

Signed-off-by: tiansuo114 <1729765480@qq.com>

1111111111111111111111

Signed-off-by: tiansuo114 <1729765480@qq.com>

Update pkg/karmadactl/cmdinit/cmdinit.go

Co-authored-by: zhzhuang-zju <m17799853869@163.com>

use metav1.ParseToLabelSelector

Signed-off-by: tiansuo114 <1729765480@qq.com>

delete useless test

Signed-off-by: tiansuo114 <1729765480@qq.com>

11

Signed-off-by: tiansuo114 <1729765480@qq.com>

fix

Signed-off-by: tiansuo114 <1729765480@qq.com>
2024-09-09 20:05:23 +08:00
Joe Nathan Abellard b6fbcb4353 Add the ability to specify namespace to be used for discovering scheduler estimator services
Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>

Address comments

Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>

Address comments

Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>
2024-09-09 07:21:57 -04:00
Anuj Agrawal e648c1bedb Added tests for cronfederatedhpa controller
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for pkg/controllers/cronfederatedhpa

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for controllers/cronfederatedhpa

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
2024-09-09 14:44:12 +05:30
Mohamed Awnallah fa4a077865 pkg: test ResourceDeletionProtection valid webhook
In this commit, we add unit tests for the `ValidatingAdmission` validation webhook
specifically for the resource deletion protection feature. These tests ensure
that the webhook correctly handles various admission scenarios:

- Tests the behavior when decoding the request object fails, verifying that admission
is denied with an appropriate error message.
- Ensures that resources labeled with `DeletionProtectionAlways` are denied deletion,
validating that the error message is returned.
- Confirms that resources without the deletion protection label are allowed to be deleted
without errors.
- Validates that resources with other labels are not impacted and are allowed to be deleted.
- Confirms that non-delete operations (e.g., create) are allowed by default.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-09 03:56:52 +03:00
Mohamed Awnallah 5a2e714a3b pkg: test ClusterOverridePolicy validation webhook
In this commit, we add unit tests for the `ValidationAdmission`
webhook specifically for the `ClusterOverridePolicy` resource. These
tests ensure that the webhook correctly handles various admission
scenarios:

- Tests the behavior when decoding the request object fails, verifying
that the admission is denied with an approriate error message.
- Validates that the webhook denies admission when encountering invalid
label values in the `ClusterOverridePolicy` spec, ensuring proper error messaging.
- Confirms that valid `ClusterOverridePolicy` objects are admissionly allowed
without errors.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-09-09 03:26:49 +03:00
xovoxy 503fb93068 add test for pkg/controllers/cluster
Signed-off-by: xovoxy <xilovele@gmail.com>
2024-09-08 19:56:21 +08:00
karmada-bot 32c2ef7aa4
Merge pull request #5430 from spiritNO1/fix_aggregated
fix: aggregate apiserver http method to get
2024-09-06 09:22:52 +08:00
ahorine 5d2cf3ef7e feat: Added 's' shorthand to operation-scope flags
The operation-scope flag gets used a lot when examining resources on
member clusters. The 's' shorthand was added to improve user QoL.

Signed-off-by: ahorine <allen.horine@gmail.com>
2024-09-04 16:52:46 -04:00
zhzhuang-zju d351e3dc72 add commandGroup annotation to ctl command
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-09-04 16:47:38 +08:00
zhzhuang-zju e2392fb07c chore: remove redundancy certificate configuration
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-09-03 20:07:23 +08:00
karmada-bot 350838dc22
Merge pull request #5029 from XiShanYongYe-Chang/remove-pp-name-length-limit
Remove pp/cpp name length limit
2024-08-31 11:28:48 +08:00
karmada-bot cb5be63eea
Merge pull request #5462 from mohamedawnallah/reformatInterpretHelpCommand
pkg/karmadactl/interpret/interpret.go: Reformat `karmadactl interpret --help` output
2024-08-30 17:50:47 +08:00
karmada-bot 704a873433
Merge pull request #5463 from zhzhuang-zju/karmadactlpatch
add new command patch
2024-08-30 16:50:48 +08:00
karmada-bot 307fee92ec
Merge pull request #5447 from NishantBansal2003/unit-test-dependenciesdistributor
Improved test coverage for dependencies_distributor in pkg/dependenciesdistributor
2024-08-30 16:49:47 +08:00
zhzhuang-zju 8cb9f4224c add new command patch
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-08-30 10:31:06 +08:00
Mohamed Awnallah 48e6fe7e0f pkg/karmadactl/interpret/interpret.go: chore help
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-08-29 18:53:48 +00:00
karmada-bot 6d26feb77c
Merge pull request #5458 from zhzhuang-zju/karmadactlannotate
add new command annotate
2024-08-29 21:17:47 +08:00
karmada-bot 10cc29ae92
Merge pull request #5453 from zhzhuang-zju/karmadactllabel
add new command label
2024-08-29 19:47:46 +08:00
zhzhuang-zju 65f686e473 add new command annotate
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-08-29 19:47:08 +08:00
karmada-bot bd483c141d
Merge pull request #5454 from whitewindmills/words-cleanup
Fix spelling errors
2024-08-29 19:43:46 +08:00
圣朋 48b03df9c9 fix: aggregate apiserver http method to get
Signed-off-by: 圣朋 <sp441185@alibaba-inc.com>
2024-08-29 17:59:12 +08:00
zhzhuang-zju 8b21a65f97 add new command label
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-08-29 16:02:12 +08:00
whitewindmills b4ad838227 Fix spelling errors
Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
2024-08-29 15:58:05 +08:00
Nishant Bansal 3e5ea52ac6 Improved test coverage for dependencies_distributor in pkg/dependenciesdistributor
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2024-08-29 12:49:20 +05:30
karmada-bot 47cea6a84d
Merge pull request #5432 from spiritNO1/fix_url
fix: remove extra slash when constructing member cluster URL if the apiEndpoint of the cluster object ends with a slash
2024-08-29 12:20:46 +08:00
hulizhe 1a34a70ef3 enhance top pod command
Signed-off-by: hulizhe <pompeii.hu@gmail.com>
2024-08-29 10:50:30 +08:00
karmada-bot 2efe03fac9
Merge pull request #5441 from RainbowMango/pr_bump_custom-metrics-apiserver
Bump custom-metrics-server to v1.30.0
2024-08-28 22:05:45 +08:00
圣朋 f5f351bd4a fix: remove extra slash when constructing member cluster URL to adapt the apiEndpoint of the cluster object ends with a slash.
Signed-off-by: 圣朋 <sp441185@alibaba-inc.com>
2024-08-28 17:47:32 +08:00
whitewindmills e13d06b70d skip descheduling ResourceBinding which is being deleted
Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
2024-08-28 17:05:03 +08:00
RainbowMango a968ff3d8b Bump custom-metrics-server to v1.30.0 which requires Kubernetes v1.30 as the main module
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-08-28 15:23:06 +08:00
karmada-bot 295dee80dc
Merge pull request #5381 from xovoxy/cert-rotation-ut
Improve test coverage for /pkg/controllers/certificate, with a minor optimization
2024-08-28 15:17:45 +08:00
karmada-bot d16f0985ec
Merge pull request #5437 from liangyuanpeng/scheduler_options
Standardize the health probe and metrics arguments of scheduler.
2024-08-28 09:11:45 +08:00
Lan Liang 0fceab521a Standardize the health probe and metrics arguments of scheduler.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-08-27 12:37:21 +00:00
karmada-bot a184b40a56
Merge pull request #5434 from zhzhuang-zju/karmadactledit
add new command edit
2024-08-27 20:28:45 +08:00
zhzhuang-zju e9c1df6828 add new command edit
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-08-27 19:35:13 +08:00
karmada-bot 9a678b65f0
Merge pull request #5290 from seanlaii/controller-manager-options
Standardize the health probe argument of karmada-controller-manager
2024-08-27 18:37:45 +08:00
karmada-bot 8320ccf7fb
Merge pull request #5435 from whitewindmills/descheduler-options
Standardize the health probe and metrics arguments of descheduler
2024-08-27 17:55:45 +08:00
wei-chenglai f6d022f799 Standardize the health probe argument of karmada-controller-manager
Signed-off-by: wei-chenglai <qazwsx0939059006@gmail.com>
2024-08-27 16:29:01 +08:00
karmada-bot 98b2bda5fb
Merge pull request #5427 from yashpandey06/pkg/estimator/client/service
Added tests for service file in pkg/estimator/client
2024-08-27 16:20:44 +08:00
Yash Pandey ec419583bb Added unit tests for service in pkg/estimator/client
Signed-off-by: Yash Pandey <yash.pandey@agoda.com>
2024-08-27 12:02:02 +05:30
whitewindmills d9ecf2a9ca Standardize the health probe and metrics arguments of descheduler
Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
2024-08-27 14:32:00 +08:00