Skip to content

Commit

Permalink
Remove local validation, leave it to API
Browse files Browse the repository at this point in the history
  • Loading branch information
juniocezar committed Jan 30, 2024
1 parent 26ce92e commit f1ca103
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions cyral/internal/repository/resource_cyral_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ func (r *RepoInfo) MongoDBSettingsFromInterface(i []interface{}) error {
var replicaSetName = i[0].(map[string]interface{})[RepoMongoDBReplicaSetNameKey].(string)
var serverType = i[0].(map[string]interface{})[RepoMongoDBServerTypeKey].(string)
var srvRecordName = i[0].(map[string]interface{})[RepoMongoDBSRVRecordName].(string)
var mongoFlavor = i[0].(map[string]interface{})[RepoMongoDBFlavorKey].(string)
if serverType == ReplicaSet && replicaSetName == "" {
return fmt.Errorf("'%s' must be provided when '%s=\"%s\"'", RepoMongoDBReplicaSetNameKey,
RepoMongoDBServerTypeKey, ReplicaSet)
Expand All @@ -279,13 +278,6 @@ func (r *RepoInfo) MongoDBSettingsFromInterface(i []interface{}) error {
Standalone,
)
}
if serverType == Sharded && mongoFlavor == MongoDBFlavorDocumentDB {
return fmt.Errorf(
"%q MongoDB flavor cannot be combined with server type: %q. For configuring "+
"DocumentDB Elastic clusters, please use the %s server type",
MongoDBFlavorDocumentDB, Sharded, Standalone,
)
}
r.MongoDBSettings = &MongoDBSettings{
ReplicaSetName: i[0].(map[string]interface{})[RepoMongoDBReplicaSetNameKey].(string),
ServerType: i[0].(map[string]interface{})[RepoMongoDBServerTypeKey].(string),
Expand Down

0 comments on commit f1ca103

Please sign in to comment.