From 0d5741491f5b79b4c594dcf74ecd308e1d2367bc Mon Sep 17 00:00:00 2001 From: ykadowak Date: Tue, 28 Nov 2023 06:07:52 +0000 Subject: [PATCH] Fix camel case --- internal/config/readreplica_rotate.go | 4 ++-- pkg/index/job/readreplica/rotate/config/config.go | 8 ++++---- pkg/index/job/readreplica/rotate/usecase/rotate.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/config/readreplica_rotate.go b/internal/config/readreplica_rotate.go index d3b4cf0614..c2aee1bff9 100644 --- a/internal/config/readreplica_rotate.go +++ b/internal/config/readreplica_rotate.go @@ -13,14 +13,14 @@ // limitations under the License. package config -type ReadreplicaRotate struct { +type ReadReplicaRotate struct { AgentNamespace string `json:"agent_namespace" yaml:"agent_namespace"` ReadReplicaLabelKey string `json:"read_replica_label_key" yaml:"read_replica_label_key"` ReadReplicaID string `json:"read_replica_id" yaml:"read_replica_id"` VolumeName string `json:"volume_name" yaml:"volume_name"` } -func (r *ReadreplicaRotate) Bind() *ReadreplicaRotate { +func (r *ReadReplicaRotate) Bind() *ReadReplicaRotate { r.AgentNamespace = GetActualValue(r.AgentNamespace) r.ReadReplicaLabelKey = GetActualValue(r.ReadReplicaLabelKey) r.ReadReplicaID = GetActualValue(r.ReadReplicaID) diff --git a/pkg/index/job/readreplica/rotate/config/config.go b/pkg/index/job/readreplica/rotate/config/config.go index aa35b7acb8..c656c53d95 100644 --- a/pkg/index/job/readreplica/rotate/config/config.go +++ b/pkg/index/job/readreplica/rotate/config/config.go @@ -32,8 +32,8 @@ type Data struct { // Observability represents observability configurations. Observability *config.Observability `json:"observability" yaml:"observability"` - // TODO: - ReadreplicaRotate *config.ReadreplicaRotate `json:"rotator" yaml:"rotator"` + // ReadReplicaRotate represents read replica rotate configurations. + ReadReplicaRotate *config.ReadReplicaRotate `json:"rotator" yaml:"rotator"` } // NewConfig loads configurations from the file path. @@ -62,8 +62,8 @@ func NewConfig(path string) (cfg *Data, err error) { cfg.Observability = new(config.Observability).Bind() } - if cfg.ReadreplicaRotate != nil { - _ = cfg.ReadreplicaRotate.Bind() + if cfg.ReadReplicaRotate != nil { + _ = cfg.ReadReplicaRotate.Bind() } else { return nil, errors.ErrInvalidConfig } diff --git a/pkg/index/job/readreplica/rotate/usecase/rotate.go b/pkg/index/job/readreplica/rotate/usecase/rotate.go index 6cdf7f0f60..e0a3aadf01 100644 --- a/pkg/index/job/readreplica/rotate/usecase/rotate.go +++ b/pkg/index/job/readreplica/rotate/usecase/rotate.go @@ -46,10 +46,10 @@ func New(cfg *config.Data) (_ runner.Runner, err error) { eg := errgroup.Get() rotator, err := service.New( - cfg.ReadreplicaRotate.ReadReplicaID, - service.WithNamespace(cfg.ReadreplicaRotate.AgentNamespace), - service.WithReadReplicaLabelKey(cfg.ReadreplicaRotate.ReadReplicaLabelKey), - service.WithVolumeName(cfg.ReadreplicaRotate.VolumeName), + cfg.ReadReplicaRotate.ReadReplicaID, + service.WithNamespace(cfg.ReadReplicaRotate.AgentNamespace), + service.WithReadReplicaLabelKey(cfg.ReadReplicaRotate.ReadReplicaLabelKey), + service.WithVolumeName(cfg.ReadReplicaRotate.VolumeName), ) if err != nil { return nil, err