Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
irajdeep committed Jan 18, 2024
1 parent 79bb58f commit 43aeee1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
6 changes: 6 additions & 0 deletions api/v1/mongodbcommunity_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ type AuthenticationRestriction struct {
// AutomationConfigOverride contains fields which will be overridden in the operator created config.
type AutomationConfigOverride struct {
Processes []OverrideProcess `json:"processes"`
// +kubebuilder:pruning:PreserveUnknownFields
ReplicaSets []OverrideReplicaSet `json:"replicaSets"`
}

type OverrideReplicaSet struct {
Settings MapWrapper `json:"settings,omitempty"`
}

// Note: We do not use the automationconfig.Process type directly here as unmarshalling cannot happen directly
Expand Down
23 changes: 23 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,21 @@ spec:
- name
type: object
type: array
replicaSets:
items:
properties:
settings:
description: MapWrapper is a wrapper for a map to be used
by other structs. The CRD generator does not support map[string]interface{}
on the top level and hence we need to work around this
with a wrapping struct.
type: object
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
required:
- processes
- replicaSets
type: object
featureCompatibilityVersion:
description: FeatureCompatibilityVersion configures the feature compatibility
Expand Down
11 changes: 6 additions & 5 deletions pkg/automationconfig/automation_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,12 @@ type ReplSetForceConfig struct {
}

type ReplicaSet struct {
Id string `json:"_id"`
Members []ReplicaSetMember `json:"members"`
ProtocolVersion string `json:"protocolVersion"`
NumberArbiters int `json:"numberArbiters"`
Force *ReplSetForceConfig `json:"force,omitempty"`
Id string `json:"_id"`
Members []ReplicaSetMember `json:"members"`
ProtocolVersion string `json:"protocolVersion"`
NumberArbiters int `json:"numberArbiters"`
Force *ReplSetForceConfig `json:"force,omitempty"`
Settings map[string]interface{} `json:"settings,omitempty"`
}

type ReplicaSetMember struct {
Expand Down

0 comments on commit 43aeee1

Please sign in to comment.