From c3e80adbc1a3c0ae3fee0a0538340754c72713a0 Mon Sep 17 00:00:00 2001 From: "jose.vazquez" Date: Thu, 4 Dec 2025 17:26:07 +0100 Subject: [PATCH 1/2] CLOUDP-363397: Remove old SDK badge and references --- README.md | 1 - docs/testing.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 91b51e05cc..26e8070063 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # MongoDB Atlas Operator [![MongoDB Atlas Operator](https://github.com/mongodb/mongodb-atlas-kubernetes/workflows/Test/badge.svg)](https://github.com/mongodb/mongodb-atlas-kubernetes/actions/workflows/test.yml?query=branch%3Amain) -[![MongoDB Atlas Go Client](https://img.shields.io/badge/Powered%20by%20-go--client--mongodb--atlas-%2313AA52)](https://github.com/mongodb/go-client-mongodb-atlas) The MongoDB Atlas Operator provides a native integration between the Kubernetes orchestration platform and MongoDB Atlas — the only multi-cloud document database service that gives you the versatility you need to build sophisticated and diff --git a/docs/testing.md b/docs/testing.md index 8a89938ba1..c91b64eabc 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -60,7 +60,7 @@ For Kubernetes, the [operator-runtime library has a fake package](https://pkg.go ### Atlas -For Atlas, the operator currently uses the [go-client-mongodb-atlas](https://github.com/mongodb/go-client-mongodb-atlas#go-client-mongodb-atlas). This [client main struct is composed of a set of interfaces](https://pkg.go.dev/go.mongodb.org/atlas@v0.31.0/mongodbatlas#Client), one per Service behind Atlas. A simple way to mock such a client for unit tests, that will probably only call a couple of API endpoints from Atlas at a time, is to replace those service implementations by the mock: +For Atlas, the operator currently uses the [Atlas Go SDK](https://github.com/mongodb/atlas-sdk-go). This [client main struct is composed of a set of interfaces](https://pkg.go.dev/go.mongodb.org/atlas@v0.31.0/mongodbatlas#Client), one per Service behind Atlas. A simple way to mock such a client for unit tests, that will probably only call a couple of API endpoints from Atlas at a time, is to replace those service implementations by the mock: - The mock is an struct that implements the Service interface by calling methods set in that struct for each of the interface methods defined. [See sample below](#sample-snippets). - Under `test/atlas` you should find all mocked services already being unit tested using this approach. From 30504d408f984195ebaad9c7c4c340aa5a07c472 Mon Sep 17 00:00:00 2001 From: "jose.vazquez" Date: Thu, 4 Dec 2025 17:28:57 +0100 Subject: [PATCH 2/2] Remove also related comments to the old SDK --- test/int/deployment_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/int/deployment_test.go b/test/int/deployment_test.go index a6f4664e51..079a6e7561 100644 --- a/test/int/deployment_test.go +++ b/test/int/deployment_test.go @@ -619,7 +619,6 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment- checkAtlasState(func(c *admin.ClusterDescription20240805) { // Expect(*c.DiskSizeGB).To(BeEquivalentTo(prevDiskSize)) // todo: find out if this should still work for advanced clusters - // check whether https://github.com/mongodb/go-client-mongodb-atlas/issues/140 is fixed Expect(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.DiskSizeGB).To(BeAssignableToTypeOf(pointer.MakePtr[float64](0)), "DiskSizeGB is no longer a *float64, please check the spec!") }) }) @@ -691,7 +690,6 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment- checkAtlasState(func(c *admin.ClusterDescription20240805) { Expect(int(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.GetDiskSizeGB())).To(BeEquivalentTo(*createdDeployment.Spec.DeploymentSpec.DiskSizeGB)) - // check whether https://github.com/mongodb/go-client-mongodb-atlas/issues/140 is fixed Expect(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.DiskSizeGB).To(BeAssignableToTypeOf(pointer.MakePtr[float64](0)), "DiskSizeGB is no longer a *float64, please check the spec!") }) })