Commit Graph

244 Commits

Author SHA1 Message Date
zhzhuang-zju e8aa2ff651 add script to deploy karmada-operator and karmada instance
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
2024-10-24 16:00:01 +08:00
Joe Nathan Abellard 54427360c8 Onwards!
Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>

Onwards!

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

Onwards!

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

Onwards!

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

Onwards!

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

Onwards!

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

Onwards!

Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>
2024-10-23 07:10:57 -04:00
B1F030 8b6d4c4fc1 minimize the rbac permissions for karmada-operator
Signed-off-by: B1F030 <646337422@qq.com>
2024-10-22 11:10:38 +08:00
Mohamed Awnallah 6c68781889 operator/pkg/certs/store_test: fix flaky test
In this commit, we fix flaky test in `store_test.go` by using
`GetCert` to retrieve secrets instead of unreliable `CertList`
indexing due to non-guarnteed map order.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-21 16:29:26 +03:00
karmada-bot a3005d770b
Merge pull request #5636 from mohamedawnallah/unitTestRBACInitTaskOperatorPkg
operator/pkg/tasks/init: unit test rbac
2024-10-21 12:04:31 +08:00
karmada-bot 98b600d7d1
Merge pull request #5625 from mohamedawnallah/unitTestCertTaskInitOperatorPkg
operator/pkg/tasks/init: unit test cert
2024-10-21 11:27:31 +08:00
Mohamed Awnallah a83c26eac9 operator/pkg/certs: test certs
In this commit, we introduce unit tests for operator `certs` package.
The test cases include but not limited to:

- Test private key generation.
- Test self-signed certificate authority (CA) generation.
- Verify creation of self-signed certificate and key files within the CA.
- Include tests for utility functions, such as appending to Subject Alternative Names in SSL/TLS certificates.
- Add tests for Karmada Store operations related to certificates stored in Kubernetes Secrets:
  - Create
  - Read
  - Update
  - Load

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-19 15:47:05 +03:00
karmada-bot 31bc0224f2
Merge pull request #5699 from jabellard/external_etcd_3
External `etcd` Support for Karmada Operator - Part 1
2024-10-19 19:27:29 +08:00
Joe Nathan Abellard b8de9678e2 Onwards!
Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>

Onwards!

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

Onwards!

Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>
2024-10-19 06:30:32 -04:00
Mohamed Awnallah 33b75f7b08 operator/pkg: unit test cert tasks
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-19 12:46:28 +03: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
Rishi Mondal 29980be10e chore: update image tags for Karmada components to v1.11.1
Signed-off-by: Rishi Mondal <mavrickrishi@gmail.com>
2024-10-19 10:28:41 +05:30
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 d1433e2562
Merge pull request #5583 from mohamedawnallah/unitTestEtcdOperatorPkg
operator/pkg/controlplane: unit test etcd
2024-10-18 11:56:29 +08:00
karmada-bot cfadb48084
Merge pull request #5576 from mohamedawnallah/unitTestControlPlaneOperatorPkg
operator/pkg/controlplane: unit test apiserver
2024-10-18 11:53:28 +08:00
karmada-bot 9531f0f3bb
Merge pull request #5603 from mohamedawnallah/unitTestRBACOperator
operator/pkg/karmadaresource: unit test RBAC
2024-10-18 11:49:28 +08:00
karmada-bot fc7da71575
Merge pull request #5585 from mohamedawnallah/unitTestMetricsAdapter
operator/pkg/controlplane: unit test Metrics Adapter
2024-10-18 11:24:28 +08:00
karmada-bot 12aa64e9fc
Merge pull request #5565 from mohamedawnallah/unitTestKarmadaControllerOfOperator
operator/pkg/controller/karmada: unit test Karmada controller
2024-10-18 11:21:28 +08:00
karmada-bot 1a958e2558
Merge pull request #5596 from mohamedawnallah/unitTestAPIServiceKarmadaResourceOperatorPkg
operator/pkg/karmadaresource/apiservice: unit test apiservice
2024-10-18 10:20:28 +08:00
karmada-bot ee1e751327
Merge pull request #5587 from mohamedawnallah/unitTestKarmadaSearchControlPlaneOperatorPkg
operator/pkg/controlplane: unit test karmada search
2024-10-18 10:05:28 +08:00
Mohamed Awnallah 06a45c3ad4 operator/pkg/controller: test karmada controller
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-18 03:48:26 +03:00
Mohamed Awnallah 1474463e81 operator/pkg: test apiservice
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-17 19:28:05 +03:00
Mohamed Awnallah 6a83fe478c operator/pkg/tasks/init: test rbac
In this commit, we unit test rbac in the karmada init task
operator package by checking that cluster roles and their associated
cluster role bindings are created as expected.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-17 18:11:01 +03:00
karmada-bot 0d55eadb89
Merge pull request #5659 from mohamedawnallah/unitTestWaitAPIClient
operator/pkg/util/apiclient: unit test wait
2024-10-17 20:41:29 +08: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
karmada-bot 46d94ecc86
Merge pull request #5647 from mohamedawnallah/unitTestWorkflowJob
operator/pkg/workflow: unit test job
2024-10-17 11:12:28 +08:00
karmada-bot c230b14827
Merge pull request #5560 from mohamedawnallah/fixNullPointerDereferenceInAltNamesMutators
operator/pkg/certs: mitigate potential null pointer dereference in AltNames Mutators for both the `APIServer` and `EtcdServer`
2024-10-17 09:28:28 +08:00
Mohamed Awnallah f74dbb0519 operator/pkg/karmadaresource: test RBAC
In this commit, we add unit tests for the RBAC in the karamada resource
operator pkg making sure Karmada Resource View Clusterrole and Karmada
Resource Edit Clusterrole are working as expected.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 20:48:45 +03:00
Mohamed Awnallah a7dd3f887c operator/pkg/controlplane: test karmada search
In this commit, we include unit tests for karmada search in the
operator control plane package to make sure installing karmada search
and its associated service are working as expected.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 20:41:23 +03:00
Mohamed Awnallah f9d9b098c1 operator/pkg/controlplane: test metricsadapter
In this commit, we add unit tests for the metrics adapter controlplane pkg
of the operator making sure that installing Karmada Metrics Adapter Deployment
works as expect and its associated service.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 20:40:40 +03:00
Mohamed Awnallah 4bec426855 operator/pkg/controlplane: test etcd
In this commit, we include unit test cases for the etcd controlplane
pkg of the operator making sure that installing Karmada Etcd Statefulset
works as expected and its associated Etcd client/peer services.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 20:39:54 +03:00
Mohamed Awnallah 255b0b859f operator/pkg/controlplane: test apiserver
In this commit, we introduce unit tests for both control plane
apiserver and aggregated apiserver for the operator.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 20:38:32 +03:00
Mohamed Awnallah 5ef98ec66f operator/pkg/util: unit test patcher
In this commit, we unit test the patcher in the karmada operator
pkg on patching the Deployment and StatefulSet K8S objects.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-16 19:59:19 +03:00
karmada-bot 268e6725a0
Merge pull request #5676 from mohamedawnallah/unitTestKubeConfigDeInit
operator/pkg/tasks/deinit: unit test kubeconfig
2024-10-14 15:54:25 +08:00
karmada-bot dcdabc9278
Merge pull request #5678 from mohamedawnallah/unitTestComponentDeInitTask
operator/pkg/tasks/deinit: unit test component
2024-10-14 15:32:25 +08:00
Mohamed Awnallah 085148bfc6 operator/pkg/util/apiclient: unit test wait
In this commit, we unit test the API client on waiting for API server,
API service, all pods constraint, some pods constraint, and the exponential
backoff utility.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-12 10:46:22 +03:00
Mohamed Awnallah 04d073c12d operator/pkg/tasks: unit test wait init task
In this commit, we unit test wait init task on waiting for Karmada APIServer
and Karmada Control Plane components.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-12 10:42:01 +03:00
karmada-bot 201409c98c
Merge pull request #5643 from mohamedawnallah/unitTestCertDeInitTaskOperatorPkg
operator/pkg/tasks/deinit: unit test cert
2024-10-12 15:07:24 +08:00
karmada-bot 23bcebc82c
Merge pull request #5624 from mohamedawnallah/unitTestAPIServerTaskInitOperatorPKG
operator/pkg/tasks: unit test apiserver
2024-10-12 14:16:23 +08:00
Mohamed Awnallah fddfb29a85 operator/pkg/tasks/deinit: unit test component
In this commit, we unit test component deinit task in the karmada
operator package on removing component subtasks and etcd component.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-12 08:41:50 +03:00
Mohamed Awnallah 2c7aea5f9e operator/pkg/tasks: test cert deinit task
In this commit, we unit test the cert deinit task on the
clean up operations.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-12 07:23:20 +03:00
karmada-bot 0f26e6e95c
Merge pull request #5590 from mohamedawnallah/unitTestKarmadaControlPlaneOperatorPkg
operator/pkg/controlplane: unit test controlplane
2024-10-12 11:49:23 +08:00
karmada-bot 3e0516fb96
Merge pull request #5588 from mohamedawnallah/unitTestKarmadaWebhook
operator/pkg/controlplane: unit test karmada webhook
2024-10-12 11:23:23 +08:00
Mohamed Awnallah cbeb308cdf operator/pkg/tasks/deinit: unit test kubeconfig
In this commit, we unit test kubeconfig deinit task in the operator
package on cleaning up the secret if it has the given labels.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-11 21:11:26 +03:00
Mohamed Awnallah 11bd90ecf8 operator/pkg/workflow: test job
In this commit, we unit test the job workflow in the operator
package on initializing the running data runtime interface and
running tasks and subtasks recursively.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-11 12:57:49 +03:00
karmada-bot 21467f88e5
Merge pull request #5665 from mohamedawnallah/unitTestKubeConfigUtilOperatorPKG
operator/pkg/util: unit test kubeconfig
2024-10-11 15:13:23 +08:00
Mohamed Awnallah 95ba0cdee9 operator/pkg/util: unit test kubeconfig
In this commit, we unit test kubeconfig utility in the karmada
operator package on building client from secret reference and checking
whether the given cluster is local or remote.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
Co-authored-by: zhzhuang-zju <m17799853869@163.com>
2024-10-11 05:29:56 +03:00
karmada-bot 6e41d9b930
Merge pull request #5666 from mohamedawnallah/unitTestNamingUtil
operator/pkg/util: unit test naming
2024-10-11 10:08:22 +08:00
karmada-bot cadb9461a8
Merge pull request #5667 from mohamedawnallah/unitTestTemplateUtil
operator/pkg/util: unit test template
2024-10-11 10:05:22 +08:00
Mohamed Awnallah 56bdcc4fed operator/pkg/util: unit test template
In this commit, we unit test template on parsing template functionality
on parsing and executing html templates with passed args.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
2024-10-10 17:22:35 +03:00