Skip to content

Commit 6f6cb4b

Browse files
committed
Fix minor typos
1 parent a72c3f9 commit 6f6cb4b

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

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)