Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
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
30 changes: 2 additions & 28 deletions cmd/agent/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import (

"github.com/mariadb-operator/agent/pkg/filemanager"
"github.com/mariadb-operator/agent/pkg/handler"
"github.com/mariadb-operator/agent/pkg/handler/bootstrap"
"github.com/mariadb-operator/agent/pkg/handler/recovery"
"github.com/mariadb-operator/agent/pkg/logger"
"github.com/mariadb-operator/agent/pkg/mariadbd"
"github.com/mariadb-operator/agent/pkg/router"
"github.com/mariadb-operator/agent/pkg/server"
"github.com/spf13/cobra"
Expand All @@ -30,13 +28,8 @@ var (
logTimeEncoder string
logDev bool

bootstrapMariadbdReloadRetries int
bootstrapMariadbdReloadRetryWait time.Duration

recoveryMariadbdReloadRetries int
recoveryMariadbdReloadRetryWait time.Duration
recoveryRetries int
recoveryRetryWait time.Duration
recoveryRetries int
recoveryRetryWait time.Duration
)

var rootCmd = &cobra.Command{
Expand All @@ -62,17 +55,7 @@ var rootCmd = &cobra.Command{

handlerLogger := logger.WithName("handler")
handler := handler.NewHandler(fileManager, &handlerLogger,
handler.WithBootstrapOptions(
bootstrap.WithMariadbdReload(&mariadbd.ReloadOptions{
Retries: bootstrapMariadbdReloadRetries,
WaitRetry: bootstrapMariadbdReloadRetryWait,
}),
),
handler.WithRecoveryOptions(
recovery.WithMariadbdReload(&mariadbd.ReloadOptions{
Retries: recoveryMariadbdReloadRetries,
WaitRetry: recoveryMariadbdReloadRetryWait,
}),
recovery.WithRecovery(&recovery.RecoveryOptions{
Retries: recoveryRetries,
WaitRetry: recoveryRetryWait,
Expand Down Expand Up @@ -114,15 +97,6 @@ func init() {
"epoch, millis, nano, iso8601, rfc3339 or rfc3339nano")
rootCmd.Flags().BoolVar(&logDev, "log-dev", false, "Enable development logs.")

rootCmd.Flags().IntVar(&bootstrapMariadbdReloadRetries, "bootstrap-mariadbd-reload-retries", 10, "Maximum number of attempts "+
"to reload MariaDB process when bootstraping a new Galera cluster")
rootCmd.Flags().DurationVar(&bootstrapMariadbdReloadRetryWait, "bootstrap-mariadbd-reload-retry-wait", 1*time.Second,
"Time to wait between MariaDB process reload attempts when bootstrapping a new Galera cluster")

rootCmd.Flags().IntVar(&recoveryMariadbdReloadRetries, "recovery-mariadbd-reload-retries", 3, "Maximum number of attempts "+
"to reload MariaDB process when recovering the Galera cluster")
rootCmd.Flags().DurationVar(&recoveryMariadbdReloadRetryWait, "recovery-mariadbd-reload-retry-wait", 1*time.Second,
"Time to wait between MariaDB process reload attempts when recovering the Galera cluster")
rootCmd.Flags().IntVar(&recoveryRetries, "recovery-retries", 10, "Maximum number of attempts "+
"to recover the Galera cluster")
rootCmd.Flags().DurationVar(&recoveryRetryWait, "recovery-retry-wait", 3*time.Second, "Time to wait between "+
Expand Down
28 changes: 0 additions & 28 deletions docker-compose.yml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/1-bootstrap.cnf

This file was deleted.

3 changes: 0 additions & 3 deletions examples/2-recovery.cnf

This file was deleted.

4 changes: 0 additions & 4 deletions examples/grastate-recovery.dat

This file was deleted.

4 changes: 0 additions & 4 deletions examples/grastate-safe-bootstrap.dat

This file was deleted.

4 changes: 0 additions & 4 deletions examples/grastate-seqno.dat

This file was deleted.

22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ require (
github.com/go-chi/chi/v5 v5.0.8
github.com/go-chi/httprate v0.7.4
github.com/go-logr/logr v1.2.4
github.com/google/uuid v1.3.0
github.com/mitchellh/go-ps v1.0.0
github.com/spf13/cobra v1.7.0
go.uber.org/zap v1.24.0
sigs.k8s.io/controller-runtime v0.15.0
github.com/google/uuid v1.3.0
sigs.k8s.io/controller-runtime v0.12.3
)

require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -25,13 +25,13 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
k8s.io/apimachinery v0.24.2 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
)
Loading