From 8f942a16d99c8ab4572385bf342a661d28c262f6 Mon Sep 17 00:00:00 2001 From: Roo Thorp Date: Mon, 13 Jan 2025 11:49:49 +0000 Subject: [PATCH] small fixes after rebase --- internal/controller/atlasdatabaseuser/databaseuser.go | 6 +++++- test/helper/contract/ako.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/controller/atlasdatabaseuser/databaseuser.go b/internal/controller/atlasdatabaseuser/databaseuser.go index b8bbe52e9f..f24aa719ec 100644 --- a/internal/controller/atlasdatabaseuser/databaseuser.go +++ b/internal/controller/atlasdatabaseuser/databaseuser.go @@ -52,8 +52,12 @@ func (r *AtlasDatabaseUserReconciler) handleDatabaseUser(ctx *workflow.Context, if err != nil { return r.terminate(ctx, atlasDatabaseUser, api.DatabaseUserReadyType, workflow.AtlasAPIAccessNotConfigured, true, err) } + sdkClientSet, _, err := r.AtlasProvider.SdkClientSet(ctx.Context, credentials, r.Log) + if err != nil { + return r.terminate(ctx, atlasDatabaseUser, api.DatabaseUserReadyType, workflow.AtlasAPIAccessNotConfigured, true, err) + } dbUserService := dbuser.NewAtlasUsers(sdkClient.DatabaseUsersApi) - deploymentService := deployment.NewAtlasDeployments(sdkClient.ClustersApi, sdkClient.ServerlessInstancesApi, sdkClient.GlobalClustersApi, r.AtlasProvider.IsCloudGov()) + deploymentService := deployment.NewAtlasDeployments(sdkClient.ClustersApi, sdkClient.ServerlessInstancesApi, sdkClient.GlobalClustersApi, sdkClientSet.SdkClient20241113001.FlexClustersApi, r.AtlasProvider.IsCloudGov()) atlasProject, err := r.ResolveProject(ctx.Context, sdkClient, atlasDatabaseUser, orgID) if err != nil { return r.terminate(ctx, atlasDatabaseUser, api.DatabaseUserReadyType, workflow.AtlasAPIAccessNotConfigured, true, err) diff --git a/test/helper/contract/ako.go b/test/helper/contract/ako.go index 6f8b01a365..88eb79869e 100644 --- a/test/helper/contract/ako.go +++ b/test/helper/contract/ako.go @@ -10,9 +10,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + adminv20241113001 "go.mongodb.org/atlas-sdk/v20241113001/admin" + akov2 "github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/controller/atlas" - adminv20241113001 "go.mongodb.org/atlas-sdk/v20241113001/admin" ) func DefaultAtlasProject(name string) client.Object {