Skip to content

Commit 8117a87

Browse files
authored
CLOUDP-136888: Add Project Settings (#716)
1 parent 4e6130e commit 8117a87

21 files changed

+335
-54
lines changed

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
"multinamespaced",
8989
"networkpeering",
9090
"privatelink",
91+
"project-settings",
9192
"x509auth",
9293
]
9394

@@ -217,4 +218,4 @@ jobs:
217218
uses: actions/upload-artifact@v3
218219
with:
219220
name: logs
220-
path: test/e2e/output/**
221+
path: test/e2e/output/**

config/crd/bases/atlas.mongodb.com_atlasbackuppolicies.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -116,9 +115,3 @@ spec:
116115
storage: true
117116
subresources:
118117
status: {}
119-
status:
120-
acceptedNames:
121-
kind: ""
122-
plural: ""
123-
conditions: []
124-
storedVersions: []

config/crd/bases/atlas.mongodb.com_atlasbackupschedules.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -115,9 +114,3 @@ spec:
115114
storage: true
116115
subresources:
117116
status: {}
118-
status:
119-
acceptedNames:
120-
kind: ""
121-
plural: ""
122-
conditions: []
123-
storedVersions: []

config/crd/bases/atlas.mongodb.com_atlasdatabaseusers.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -213,9 +212,3 @@ spec:
213212
storage: true
214213
subresources:
215214
status: {}
216-
status:
217-
acceptedNames:
218-
kind: ""
219-
plural: ""
220-
conditions: []
221-
storedVersions: []

config/crd/bases/atlas.mongodb.com_atlasdeployments.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -520,6 +519,8 @@ spec:
520519
type: string
521520
noTableScan:
522521
type: boolean
522+
oplogMinRetentionHours:
523+
type: string
523524
oplogSizeMB:
524525
format: int64
525526
type: integer
@@ -798,9 +799,3 @@ spec:
798799
storage: true
799800
subresources:
800801
status: {}
801-
status:
802-
acceptedNames:
803-
kind: ""
804-
plural: ""
805-
conditions: []
806-
storedVersions: []

config/crd/bases/atlas.mongodb.com_atlasprojects.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -498,6 +497,20 @@ spec:
498497
type: string
499498
type: object
500499
type: array
500+
settings:
501+
description: Settings allow to set Project Settings for the project
502+
properties:
503+
isCollectDatabaseSpecificsStatisticsEnabled:
504+
type: boolean
505+
isDataExplorerEnabled:
506+
type: boolean
507+
isPerformanceAdvisorEnabled:
508+
type: boolean
509+
isRealtimePerformancePanelEnabled:
510+
type: boolean
511+
isSchemaAdvisorEnabled:
512+
type: boolean
513+
type: object
501514
withDefaultAlertsSettings:
502515
default: true
503516
description: Flag that indicates whether to create the new project
@@ -776,9 +789,3 @@ spec:
776789
storage: true
777790
subresources:
778791
status: {}
779-
status:
780-
acceptedNames:
781-
kind: ""
782-
plural: ""
783-
conditions: []
784-
storedVersions: []

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ require (
1919
github.com/pborman/uuid v1.2.1
2020
github.com/sethvargo/go-password v0.2.0
2121
github.com/stretchr/testify v1.8.0
22-
go.mongodb.org/atlas v0.16.0
22+
go.mongodb.org/atlas v0.18.0
2323
go.mongodb.org/mongo-driver v1.10.2
2424
go.uber.org/zap v1.23.0
2525
google.golang.org/api v0.96.0
26+
gopkg.in/yaml.v2 v2.4.0
2627
gopkg.in/yaml.v3 v3.0.1
2728
k8s.io/api v0.25.0
2829
k8s.io/apimachinery v0.25.0
@@ -105,7 +106,6 @@ require (
105106
google.golang.org/grpc v1.47.0 // indirect
106107
google.golang.org/protobuf v1.28.0 // indirect
107108
gopkg.in/inf.v0 v0.9.1 // indirect
108-
gopkg.in/yaml.v2 v2.4.0 // indirect
109109
k8s.io/apiextensions-apiserver v0.25.0 // indirect
110110
k8s.io/component-base v0.25.0 // indirect
111111
k8s.io/klog/v2 v2.70.1 // indirect

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F
176176
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
177177
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
178178
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
179-
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
180179
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
181180
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
182181
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
@@ -427,8 +426,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
427426
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
428427
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
429428
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
430-
go.mongodb.org/atlas v0.16.0 h1:IqnDuK3XAZUgJ5lPHc4v4z4B8F6mvsS37O4ck7tOYVc=
431-
go.mongodb.org/atlas v0.16.0/go.mod h1:lQhRHIxc6jQHEK3/q9WLu/SdBkPj2fQYhjLGUF6Z3U8=
429+
go.mongodb.org/atlas v0.18.0 h1:hDEBykn31FlW0KKMt3xsGyqOrx+jkxB9jCO4GLhH6M0=
430+
go.mongodb.org/atlas v0.18.0/go.mod h1:GUuW7/ZrHzCO0o47aiqhokN0N6i0GM3yraRyHIBTykU=
432431
go.mongodb.org/mongo-driver v1.10.2 h1:4Wk3cnqOrQCn0P92L3/mmurMxzdvWWs5J9jinAVKD+k=
433432
go.mongodb.org/mongo-driver v1.10.2/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
434433
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=

pkg/api/v1/atlasdeployment_types.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,24 @@ type ComputeSpec struct {
289289
MaxInstanceSize string `json:"maxInstanceSize,omitempty"`
290290
}
291291

292-
type ProcessArgs mongodbatlas.ProcessArgs
292+
type ProcessArgs struct {
293+
DefaultReadConcern string `json:"defaultReadConcern,omitempty"`
294+
DefaultWriteConcern string `json:"defaultWriteConcern,omitempty"`
295+
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
296+
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
297+
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
298+
NoTableScan *bool `json:"noTableScan,omitempty"`
299+
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
300+
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
301+
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
302+
OplogMinRetentionHours string `json:"oplogMinRetentionHours,omitempty"`
303+
}
304+
305+
func (specArgs ProcessArgs) ToAtlas() (*mongodbatlas.ProcessArgs, error) {
306+
result := &mongodbatlas.ProcessArgs{}
307+
err := compat.JSONCopy(result, specArgs)
308+
return result, err
309+
}
293310

294311
func (specArgs ProcessArgs) IsEqual(newArgs interface{}) bool {
295312
specV := reflect.ValueOf(specArgs)

pkg/api/v1/atlasdeployment_types_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func init() {
4444
excludedClusterFieldsTheirs["links"] = true
4545
excludedClusterFieldsTheirs["createDate"] = true
4646
excludedClusterFieldsTheirs["versionReleaseSystem"] = true
47+
excludedClusterFieldsTheirs["serverlessBackupOptions"] = true
4748
}
4849

4950
func TestCompatibility(t *testing.T) {

0 commit comments

Comments
 (0)