Skip to content

Commit af2c7ef

Browse files
authored
Manually bump Atlas client to version 0.32 (#1077)
1 parent 01947f0 commit af2c7ef

File tree

7 files changed

+16
-18
lines changed

7 files changed

+16
-18
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/pborman/uuid v1.2.1
2525
github.com/sethvargo/go-password v0.2.0
2626
github.com/stretchr/testify v1.8.4
27-
go.mongodb.org/atlas v0.31.0
27+
go.mongodb.org/atlas v0.32.0
2828
go.mongodb.org/mongo-driver v1.12.1
2929
go.uber.org/zap v1.25.0
3030
golang.org/x/sync v0.3.0
@@ -42,7 +42,6 @@ require (
4242
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
4343
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 // indirect
4444
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
45-
github.com/benbjohnson/clock v1.3.0 // indirect
4645
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
4746
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
4847
github.com/google/s2a-go v0.1.4 // indirect

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ github.com/aws/aws-sdk-go v1.44.318 h1:Yl66rpbQHFUbxe9JBKLcvOvRivhVgP6+zH0b9KzAR
9696
github.com/aws/aws-sdk-go v1.44.318/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
9797
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
9898
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
99-
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
10099
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
101100
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
102101
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -400,8 +399,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
400399
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
401400
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
402401
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
403-
go.mongodb.org/atlas v0.31.0 h1:NgLqsNYm6wDYeDUO90etw1sl8T1U2DUKu36eUdnrFSI=
404-
go.mongodb.org/atlas v0.31.0/go.mod h1:L4BKwVx/OeEhOVjCSdgo90KJm4469iv7ZLzQms/EPTg=
402+
go.mongodb.org/atlas v0.32.0 h1:6uHwus8Bz+h1Ax75Pf3qo3kWCwnaUYav+SxSMU2RGiQ=
403+
go.mongodb.org/atlas v0.32.0/go.mod h1:L4BKwVx/OeEhOVjCSdgo90KJm4469iv7ZLzQms/EPTg=
405404
go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE=
406405
go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ=
407406
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=

pkg/api/v1/status/cloud_provider_access.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (c *CloudProviderAccessRole) FailedToAuthorise(errorMessage string) {
5656
c.ErrorMessage = errorMessage
5757
}
5858

59-
func (c *CloudProviderAccessRole) Update(role mongodbatlas.AWSIAMRole, isEmptyArn bool) {
59+
func (c *CloudProviderAccessRole) Update(role mongodbatlas.CloudProviderAccessRole, isEmptyArn bool) {
6060
c.RoleID = role.RoleID
6161
c.AtlasAssumedRoleExternalID = role.AtlasAssumedRoleExternalID
6262
c.AtlasAWSAccountArn = role.AtlasAWSAccountARN

pkg/controller/atlasproject/cloud_provider_access.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func syncProviderAccessStatus(ctx context.Context, customContext *workflow.Conte
7070
func tryToAuthorize(ctx context.Context, access mongodbatlas.CloudProviderAccessService, logger *zap.SugaredLogger, statusMap map[v1.CloudProviderAccessRole]status.CloudProviderAccessRole, groupID string) {
7171
for spec, roleStatus := range statusMap {
7272
if roleStatus.Status == status.StatusCreated {
73-
request := mongodbatlas.CloudProviderAuthorizationRequest{
73+
request := mongodbatlas.CloudProviderAccessRoleRequest{
7474
ProviderName: spec.ProviderName,
75-
IAMAssumedRoleARN: spec.IamAssumedRoleArn,
75+
IAMAssumedRoleARN: &spec.IamAssumedRoleArn,
7676
}
7777
role, _, err := access.AuthorizeRole(ctx, groupID, roleStatus.RoleID, &request)
7878
if err != nil {
@@ -109,7 +109,7 @@ func ensureCloudProviderAccessStatus(statusMap map[v1.CloudProviderAccessRole]st
109109
return workflow.OK(), status.CloudProviderAccessReadyType
110110
}
111111

112-
func updateAccessRoles(toUpdate []mongodbatlas.AWSIAMRole, specToStatus map[v1.CloudProviderAccessRole]status.CloudProviderAccessRole) {
112+
func updateAccessRoles(toUpdate []mongodbatlas.CloudProviderAccessRole, specToStatus map[v1.CloudProviderAccessRole]status.CloudProviderAccessRole) {
113113
for _, role := range toUpdate {
114114
for spec, roleStatus := range specToStatus {
115115
if role.RoleID == roleStatus.RoleID {
@@ -212,7 +212,7 @@ func checkStatuses(specs []v1.CloudProviderAccessRole, statuses []status.CloudPr
212212

213213
type accessRoleDiff struct {
214214
toCreate []v1.CloudProviderAccessRole
215-
toUpdate []mongodbatlas.AWSIAMRole
215+
toUpdate []mongodbatlas.CloudProviderAccessRole
216216
toDelete map[string]string // roleId -> providerName
217217
}
218218

test/e2e/api/atlas/atlas.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ func ginkgoPrettyPrintf(obj interface{}, msg string, formatArgs ...interface{})
166166
ginkgo.GinkgoWriter.Println(debug.PrettyString(obj))
167167
}
168168

169-
func (a *Atlas) GetIntegrationbyType(projectId, iType string) (*mongodbatlas.ThirdPartyIntegration, error) {
170-
integraion, _, err := a.Client.Integrations.Get(context.Background(), projectId, iType)
169+
func (a *Atlas) GetIntegrationByType(projectId, iType string) (*mongodbatlas.ThirdPartyIntegration, error) {
170+
integration, _, err := a.Client.Integrations.Get(context.Background(), projectId, iType)
171171
if err != nil {
172172
return nil, err
173173
}
174-
return integraion, nil
174+
return integration, nil
175175
}
176176

177177
func (a *Atlas) GetUserByName(database, projectID, username string) (*mongodbatlas.DatabaseUser, error) {
@@ -190,7 +190,7 @@ func (a *Atlas) DeleteGlobalKey(key mongodbatlas.APIKey) error {
190190
return nil
191191
}
192192

193-
func (a *Atlas) GetEncryptioAtRest(projectID string) (*mongodbatlas.EncryptionAtRest, error) {
193+
func (a *Atlas) GetEncryptionAtRest(projectID string) (*mongodbatlas.EncryptionAtRest, error) {
194194
encryptionAtRest, _, err := a.Client.EncryptionsAtRest.Get(context.Background(), projectID)
195195
if err != nil {
196196
return nil, err

test/e2e/encryption_at_rest_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func removeAllEncryptionsSeparately(encAtRest *v1.EncryptionAtRest) {
239239

240240
func checkIfEncryptionsAreDisabled(projectID string) (areEmpty bool, err error) {
241241
atlasClient := atlas.GetClientOrFail()
242-
encryptionAtRest, err := atlasClient.GetEncryptioAtRest(projectID)
242+
encryptionAtRest, err := atlasClient.GetEncryptionAtRest(projectID)
243243
if err != nil {
244244
return false, err
245245
}

test/e2e/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("integrati
5959
func integrationCycle(data *model.TestDataProvider, key string) {
6060
integrationType := "DATADOG"
6161

62-
By("Deploy User Resouces", func() {
62+
By("Deploy User Resources", func() {
6363
projectStatus := GetProjectIntegrationStatus(data)
6464
Expect(projectStatus).Should(BeEmpty())
6565
})
@@ -94,7 +94,7 @@ func integrationCycle(data *model.TestDataProvider, key string) {
9494

9595
Expect(err).ShouldNot(HaveOccurred())
9696

97-
dog, err := atlasClient.GetIntegrationbyType(data.Project.ID(), integrationType)
97+
dog, err := atlasClient.GetIntegrationByType(data.Project.ID(), integrationType)
9898
Expect(err).ShouldNot(HaveOccurred())
9999
Expect(strings.HasSuffix(key, removeStarsFromString(dog.APIKey))).Should(BeTrue())
100100
})
@@ -108,7 +108,7 @@ func integrationCycle(data *model.TestDataProvider, key string) {
108108
})
109109

110110
By("Delete integration check", func() {
111-
integration, err := atlasClient.GetIntegrationbyType(data.Project.ID(), integrationType)
111+
integration, err := atlasClient.GetIntegrationByType(data.Project.ID(), integrationType)
112112
Expect(err).Should(HaveOccurred())
113113
Expect(integration).To(BeNil())
114114

0 commit comments

Comments
 (0)