Skip to content

Fix minor typos #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/db-controller/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func parseAllFlags(args []string) error {

fs.StringVar(&logLevelFlag, "log-level", "warning", "the log level(debug/info/warning/error)")
fs.StringVar(&lockFilePathFlag, "lock-filepath", "/var/run/db-controller/lock", "the filepath of the exclusive lock")
fs.StringVar(&dbReplicaPasswordFilePathFlag, "db-repilica-password-filepath", "/var/run/db-controller/.db-replica-password", "the filepath of the DB replica password")
fs.StringVar(&dbReplicaPasswordFilePathFlag, "db-replica-password-filepath", "/var/run/db-controller/.db-replica-password", "the filepath of the DB replica password")
fs.StringVar(&globalInterfaceNameFlag, "global-interface-name", "eth0", "the interface name of global")
fs.StringVar(&chainNameForDBAclFlag, "chain-name-for-db-acl", "mariadb", "the chain name for DB access control")
fs.StringVar(&dbReplicaUserNameFlag, "db-replica-user-name", "repl", "the username for replication")
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (c *Controller) getPreviousState() State {

// checkMariaDBHealth checks whether the MariaDB server is healthy or not.
func (c *Controller) checkMariaDBHealth() dbHealthCheckResult {
if err := c.systemdConnector.CheckServiceStatus(mariadb.SystemdSerivceName); err != nil {
if err := c.systemdConnector.CheckServiceStatus(mariadb.SystemdServiceName); err != nil {
c.logger.Debug("'systemctl status mariadb' exit with returning error", "error", err)
return dbHealthCheckResultNG
}
Expand Down Expand Up @@ -480,7 +480,7 @@ func (c *Controller) startMariaDBService() error {
if err := c.mariaDBConnector.RemoveRelayInfo(); err != nil {
return err
}
if err := c.systemdConnector.StartService(mariadb.SystemdSerivceName); err != nil {
if err := c.systemdConnector.StartService(mariadb.SystemdServiceName); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/fault_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Controller) triggerRunOnStateChangesToFault() error {
}

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

// stopMariaDBService stops the mariadb's systemd service.
func (c *Controller) stopMariaDBService() error {
if err := c.systemdConnector.StopService(mariadb.SystemdSerivceName); err != nil {
if err := c.systemdConnector.StopService(mariadb.SystemdServiceName); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/mariadb/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package mariadb

const (
SystemdSerivceName = "mariadb"
SystemdServiceName = "mariadb"
MasterInfoFilePath = "/var/lib/mysql/master.info"
RelayInfoFilePath = "/var/lib/mysql/relay-log.info"
)
2 changes: 1 addition & 1 deletion pkg/mariadb/fake_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *FakeMariaDBConnector) ChangeMasterTo(master MasterInstance) error {

// ResetAllReplicas implements mariadb.Connector
func (c *FakeMariaDBConnector) ResetAllReplicas() error {
c.Timestamp["ResetAllRelicas"] = time.Now()
c.Timestamp["ResetAllReplicas"] = time.Now()
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/nftables/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (c *nftCommandConnector) FlushChain(
func (c *nftCommandConnector) CreateChain(
chain string,
) error {
// nft add chain comand returns ok if the chain is already exist.
// nft add chain command returns ok if the chain is already exist.
name := "nft"
args := []string{"add", "chain", builtinTableFilter, chain, "{ type filter hook input priority 0; }"}
c.logger.Info("execute command", "name", name, "args", args)
Expand Down
4 changes: 2 additions & 2 deletions pkg/systemd/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (

// Connector is an interface that communicates with systemd.
type Connector interface {
// StartSerivce starts a systemd service.
// StartService starts a systemd service.
StartService(serviceName string) error

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

// StartSerivce implements Connector
// StartService implements Connector
func (c *systemCtlConnector) StartService(
serviceName string,
) error {
Expand Down