Skip to content

Commit

Permalink
Revert 6f4a785
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos committed Jul 5, 2024
1 parent 36366fd commit 26a86da
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 478 deletions.
34 changes: 0 additions & 34 deletions cmd/dbctl/dbctl.go

This file was deleted.

84 changes: 0 additions & 84 deletions cmd/dbctl/member.go

This file was deleted.

45 changes: 0 additions & 45 deletions cmd/dbctl/snapshot.go

This file was deleted.

42 changes: 0 additions & 42 deletions cmd/dbctl/util.go

This file was deleted.

44 changes: 15 additions & 29 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"os/signal"
"time"

"github.com/canonical/k8s-dqlite/cmd/dbctl"
"github.com/canonical/k8s-dqlite/pkg/etcd"
"github.com/canonical/k8s-dqlite/pkg/server"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -69,31 +67,22 @@ var (
}()
}

var (
instance server.Instance
err error
instance, err := server.New(
rootCmdOpts.dir,
rootCmdOpts.listen,
rootCmdOpts.tls,
rootCmdOpts.diskMode,
rootCmdOpts.clientSessionCacheSize,
rootCmdOpts.minTLSVersion,
rootCmdOpts.watchAvailableStorageInterval,
rootCmdOpts.watchAvailableStorageMinBytes,
rootCmdOpts.lowAvailableStorageAction,
rootCmdOpts.admissionControlPolicy,
rootCmdOpts.acpLimitMaxConcurrentTxn,
rootCmdOpts.acpOnlyWriteQueries,
)
if rootCmdOpts.etcdMode {
if instance, err = etcd.New(rootCmdOpts.dir); err != nil {
logrus.WithError(err).Fatal("Failed to create etcd server")
}
} else {
if instance, err = server.New(
rootCmdOpts.dir,
rootCmdOpts.listen,
rootCmdOpts.tls,
rootCmdOpts.diskMode,
rootCmdOpts.clientSessionCacheSize,
rootCmdOpts.minTLSVersion,
rootCmdOpts.watchAvailableStorageInterval,
rootCmdOpts.watchAvailableStorageMinBytes,
rootCmdOpts.lowAvailableStorageAction,
rootCmdOpts.admissionControlPolicy,
rootCmdOpts.acpLimitMaxConcurrentTxn,
rootCmdOpts.acpOnlyWriteQueries,
); err != nil {
logrus.WithError(err).Fatal("Failed to create server")
}
if err != nil {
logrus.WithError(err).Fatal("Failed to create server")
}

ctx, cancel := context.WithCancel(cmd.Context())
Expand Down Expand Up @@ -152,7 +141,4 @@ func init() {
// TODO(MK-1408): This value is highly dependend on underlying hardware, thus making the default value a bit useless. The linked card will implement a dynamic way to set this value.
rootCmd.Flags().Int64Var(&rootCmdOpts.acpLimitMaxConcurrentTxn, "admission-control-policy-limit-max-concurrent-transactions", 300, "Maximum number of transactions that are allowed to run concurrently. Transactions will not be admitted after the limit is reached.")
rootCmd.Flags().BoolVar(&rootCmdOpts.acpOnlyWriteQueries, "admission-control-only-for-write-queries", false, "If set, admission control will only be applied to write queries.")
rootCmd.Flags().BoolVar(&rootCmdOpts.etcdMode, "etcd-mode", false, "Run in etcd mode")

rootCmd.AddCommand(dbctl.Command)
}
16 changes: 0 additions & 16 deletions pkg/etcd/client.go

This file was deleted.

28 changes: 0 additions & 28 deletions pkg/etcd/config.go

This file was deleted.

65 changes: 0 additions & 65 deletions pkg/etcd/etcd.go

This file was deleted.

Loading

0 comments on commit 26a86da

Please sign in to comment.