Skip to content

Commit 701cec8

Browse files
authored
Merge pull request #15 from yamamoto-febc/fix/typo
Fix minor typos
2 parents cc4aa70 + 0e732ee commit 701cec8

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

cmd/db-controller/cli.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func parseAllFlags(args []string) error {
5656

5757
fs.StringVar(&logLevelFlag, "log-level", "warning", "the log level(debug/info/warning/error)")
5858
fs.StringVar(&lockFilePathFlag, "lock-filepath", "/var/run/db-controller/lock", "the filepath of the exclusive lock")
59-
fs.StringVar(&dbReplicaPasswordFilePathFlag, "db-repilica-password-filepath", "/var/run/db-controller/.db-replica-password", "the filepath of the DB replica password")
59+
fs.StringVar(&dbReplicaPasswordFilePathFlag, "db-replica-password-filepath", "/var/run/db-controller/.db-replica-password", "the filepath of the DB replica password")
6060
fs.StringVar(&globalInterfaceNameFlag, "global-interface-name", "eth0", "the interface name of global")
6161
fs.StringVar(&chainNameForDBAclFlag, "chain-name-for-db-acl", "mariadb", "the chain name for DB access control")
6262
fs.StringVar(&dbReplicaUserNameFlag, "db-replica-user-name", "repl", "the username for replication")

pkg/controller/controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (c *Controller) getPreviousState() State {
354354

355355
// checkMariaDBHealth checks whether the MariaDB server is healthy or not.
356356
func (c *Controller) checkMariaDBHealth() dbHealthCheckResult {
357-
if err := c.systemdConnector.CheckServiceStatus(mariadb.SystemdSerivceName); err != nil {
357+
if err := c.systemdConnector.CheckServiceStatus(mariadb.SystemdServiceName); err != nil {
358358
c.logger.Debug("'systemctl status mariadb' exit with returning error", "error", err)
359359
return dbHealthCheckResultNG
360360
}
@@ -480,7 +480,7 @@ func (c *Controller) startMariaDBService() error {
480480
if err := c.mariaDBConnector.RemoveRelayInfo(); err != nil {
481481
return err
482482
}
483-
if err := c.systemdConnector.StartService(mariadb.SystemdSerivceName); err != nil {
483+
if err := c.systemdConnector.StartService(mariadb.SystemdServiceName); err != nil {
484484
return err
485485
}
486486

pkg/controller/fault_state.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (c *Controller) triggerRunOnStateChangesToFault() error {
4949
}
5050

5151
// [STEP3]: setting MariaDB state
52-
if err := c.systemdConnector.KillService(mariadb.SystemdSerivceName); err != nil {
52+
if err := c.systemdConnector.KillService(mariadb.SystemdServiceName); err != nil {
5353
c.logger.Warn("failed to kill db service but ignored because i'm fault", "error", err)
5454
}
5555
if err := c.stopMariaDBService(); err != nil {
@@ -85,7 +85,7 @@ func (c *Controller) rejectDatabaseServiceTraffic() error {
8585

8686
// stopMariaDBService stops the mariadb's systemd service.
8787
func (c *Controller) stopMariaDBService() error {
88-
if err := c.systemdConnector.StopService(mariadb.SystemdSerivceName); err != nil {
88+
if err := c.systemdConnector.StopService(mariadb.SystemdServiceName); err != nil {
8989
return err
9090
}
9191

pkg/mariadb/daemon.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package mariadb
1616

1717
const (
18-
SystemdSerivceName = "mariadb"
18+
SystemdServiceName = "mariadb"
1919
MasterInfoFilePath = "/var/lib/mysql/master.info"
2020
RelayInfoFilePath = "/var/lib/mysql/relay-log.info"
2121
)

pkg/mariadb/fake_connector.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (c *FakeMariaDBConnector) ChangeMasterTo(master MasterInstance) error {
4242

4343
// ResetAllReplicas implements mariadb.Connector
4444
func (c *FakeMariaDBConnector) ResetAllReplicas() error {
45-
c.Timestamp["ResetAllRelicas"] = time.Now()
45+
c.Timestamp["ResetAllReplicas"] = time.Now()
4646
return nil
4747
}
4848

pkg/nftables/connector.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (c *nftCommandConnector) FlushChain(
8383
func (c *nftCommandConnector) CreateChain(
8484
chain string,
8585
) error {
86-
// nft add chain comand returns ok if the chain is already exist.
86+
// nft add chain command returns ok if the chain is already exist.
8787
name := "nft"
8888
args := []string{"add", "chain", builtinTableFilter, chain, "{ type filter hook input priority 0; }"}
8989
c.logger.Info("execute command", "name", name, "args", args)

pkg/systemd/connector.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828

2929
// Connector is an interface that communicates with systemd.
3030
type Connector interface {
31-
// StartSerivce starts a systemd service.
31+
// StartService starts a systemd service.
3232
StartService(serviceName string) error
3333

3434
// StopService stops a systemd service.
@@ -51,7 +51,7 @@ func NewDefaultConnector(logger *slog.Logger) Connector {
5151
return &systemCtlConnector{logger: logger}
5252
}
5353

54-
// StartSerivce implements Connector
54+
// StartService implements Connector
5555
func (c *systemCtlConnector) StartService(
5656
serviceName string,
5757
) error {

0 commit comments

Comments
 (0)