Skip to content

Commit

Permalink
feat: change the keys of the viper configs to match the flag names
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Nov 25, 2024
1 parent 3a422fa commit ed96f72
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
26 changes: 13 additions & 13 deletions go/test/endtoend/cluster/vtorc_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ type VTOrcProcess struct {
}

type VTOrcConfiguration struct {
InstancePollTime string `json:",omitempty"`
SnapshotTopologyInterval string `json:",omitempty"`
PreventCrossCellFailover bool `json:",omitempty"`
ReasonableReplicationLag string `json:",omitempty"`
AuditToBackend bool `json:",omitempty"`
AuditToSyslog bool `json:",omitempty"`
AuditPurgeDuration string `json:",omitempty"`
WaitReplicasTimeout string `json:",omitempty"`
TolerableReplicationLag string `json:",omitempty"`
TopoInformationRefreshDuration string `json:",omitempty"`
RecoveryPollDuration string `json:",omitempty"`
AllowEmergencyReparent string `json:",omitempty"`
ChangeTabletsWithErrantGtidToDrained bool `json:",omitempty"`
InstancePollTime string `json:"instance-poll-time,omitempty"`
SnapshotTopologyInterval string `json:"snapshot-topology-interval,omitempty"`
PreventCrossCellFailover bool `json:"prevent-cross-cell-failover,omitempty"`
ReasonableReplicationLag string `json:"reasonable-replication-lag,omitempty"`
AuditToBackend bool `json:"audit-to-backend,omitempty"`
AuditToSyslog bool `json:"audit-to-syslog,omitempty"`
AuditPurgeDuration string `json:"audit-purge-duration,omitempty"`
WaitReplicasTimeout string `json:"wait-replicas-timeout,omitempty"`
TolerableReplicationLag string `json:"tolerable-replication-lag,omitempty"`
TopoInformationRefreshDuration string `json:"topo-information-refresh-duration,omitempty"`
RecoveryPollDuration string `json:"recovery-poll-duration,omitempty"`
AllowEmergencyReparent string `json:"allow-emergency-reparent,omitempty"`
ChangeTabletsWithErrantGtidToDrained bool `json:"change-tablets-with-errant-gtid-to-drained,omitempty"`
LockShardTimeoutSeconds int `json:",omitempty"`
ReplicationLagQuery string `json:",omitempty"`
FailPrimaryPromotionOnLagMinutes int `json:",omitempty"`
Expand Down
30 changes: 15 additions & 15 deletions go/vt/vtorc/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (

var (
instancePollTime = viperutil.Configure(
"InstancePollTime",
"instance-poll-time",
viperutil.Options[time.Duration]{
FlagName: "instance-poll-time",
Default: 5 * time.Second,
Expand All @@ -52,7 +52,7 @@ var (
)

preventCrossCellFailover = viperutil.Configure(
"PreventCrossCellFailover",
"prevent-cross-cell-failover",
viperutil.Options[bool]{
FlagName: "prevent-cross-cell-failover",
Default: false,
Expand All @@ -61,7 +61,7 @@ var (
)

sqliteDataFile = viperutil.Configure(
"SQLiteDataFile",
"sqlite-data-file",
viperutil.Options[string]{
FlagName: "sqlite-data-file",
Default: "file::memory:?mode=memory&cache=shared",
Expand All @@ -70,7 +70,7 @@ var (
)

snapshotTopologyInterval = viperutil.Configure(
"SnapshotTopologyInterval",
"snapshot-topology-interval",
viperutil.Options[time.Duration]{
FlagName: "snapshot-topology-interval",
Default: 0 * time.Hour,
Expand All @@ -79,7 +79,7 @@ var (
)

reasonableReplicationLag = viperutil.Configure(
"ReasonableReplicationLag",
"reasonable-replication-lag",
viperutil.Options[time.Duration]{
FlagName: "reasonable-replication-lag",
Default: 10 * time.Second,
Expand All @@ -88,7 +88,7 @@ var (
)

auditFileLocation = viperutil.Configure(
"AuditFileLocation",
"audit-file-location",
viperutil.Options[string]{
FlagName: "audit-file-location",
Default: "",
Expand All @@ -97,7 +97,7 @@ var (
)

auditToBackend = viperutil.Configure(
"AuditToBackend",
"audit-to-backend",
viperutil.Options[bool]{
FlagName: "audit-to-backend",
Default: false,
Expand All @@ -106,7 +106,7 @@ var (
)

auditToSyslog = viperutil.Configure(
"AuditToSyslog",
"audit-to-syslog",
viperutil.Options[bool]{
FlagName: "audit-to-syslog",
Default: false,
Expand All @@ -115,7 +115,7 @@ var (
)

auditPurgeDuration = viperutil.Configure(
"AuditPurgeDuration",
"audit-purge-duration",
viperutil.Options[time.Duration]{
FlagName: "audit-purge-duration",
Default: 7 * 24 * time.Hour,
Expand All @@ -124,7 +124,7 @@ var (
)

waitReplicasTimeout = viperutil.Configure(
"WaitReplicasTimeout",
"wait-replicas-timeout",
viperutil.Options[time.Duration]{
FlagName: "wait-replicas-timeout",
Default: 30 * time.Second,
Expand All @@ -133,7 +133,7 @@ var (
)

tolerableReplicationLag = viperutil.Configure(
"TolerableReplicationLag",
"tolerable-replication-lag",
viperutil.Options[time.Duration]{
FlagName: "tolerable-replication-lag",
Default: 0 * time.Second,
Expand All @@ -142,7 +142,7 @@ var (
)

topoInformationRefreshDuration = viperutil.Configure(
"TopoInformationRefreshDuration",
"topo-information-refresh-duration",
viperutil.Options[time.Duration]{
FlagName: "topo-information-refresh-duration",
Default: 15 * time.Second,
Expand All @@ -151,7 +151,7 @@ var (
)

recoveryPollDuration = viperutil.Configure(
"RecoveryPollDuration",
"recovery-poll-duration",
viperutil.Options[time.Duration]{
FlagName: "recovery-poll-duration",
Default: 1 * time.Second,
Expand All @@ -160,7 +160,7 @@ var (
)

ersEnabled = viperutil.Configure(
"AllowEmergencyReparent",
"allow-emergency-reparent",
viperutil.Options[bool]{
FlagName: "allow-emergency-reparent",
Default: true,
Expand All @@ -169,7 +169,7 @@ var (
)

convertTabletsWithErrantGTIDs = viperutil.Configure(
"ChangeTabletsWithErrantGtidToDrained",
"change-tablets-with-errant-gtid-to-drained",
viperutil.Options[bool]{
FlagName: "change-tablets-with-errant-gtid-to-drained",
Default: false,
Expand Down

0 comments on commit ed96f72

Please sign in to comment.