Skip to content

Commit

Permalink
Fix camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Nov 28, 2023
1 parent bb3e72a commit 0d57414
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/config/readreplica_rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions pkg/index/job/readreplica/rotate/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -62,8 +62,8 @@ func NewConfig(path string) (cfg *Data, err error) {
cfg.Observability = new(config.Observability).Bind()
}

Check warning on line 63 in pkg/index/job/readreplica/rotate/config/config.go

View check run for this annotation

Codecov / codecov/patch

pkg/index/job/readreplica/rotate/config/config.go#L59-L63

Added lines #L59 - L63 were not covered by tests

if cfg.ReadreplicaRotate != nil {
_ = cfg.ReadreplicaRotate.Bind()
if cfg.ReadReplicaRotate != nil {
_ = cfg.ReadReplicaRotate.Bind()
} else {
return nil, errors.ErrInvalidConfig
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/index/job/readreplica/rotate/usecase/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d57414

Please sign in to comment.