Skip to content

Commit

Permalink
Add legacy-api flag to kopia server start command (#2746)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
redgoat650 and mergify[bot] committed Mar 18, 2024
1 parent 50523fd commit e288993
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/kopia/command/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
filterFlag = "--filter"
globalFlag = "--global"
jsonFlag = "--json"
legacyAPIFlag = "--legacy-api"
logDirectoryFlag = "--log-dir"
logLevelFlag = "--log-level"
LogLevelError = "error"
Expand Down
1 change: 1 addition & 0 deletions pkg/kopia/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func ServerStart(cmdArgs ServerStartCommandArgs) []string {

// TODO: Remove when GRPC support is added
args = args.AppendLoggable(noGrpcFlag)
args = args.AppendLoggable(legacyAPIFlag)

if cmdArgs.EnablePprof {
args = args.AppendLoggable(enablePprof)
Expand Down
8 changes: 4 additions & 4 deletions pkg/kopia/command/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (kServer *KopiaServerTestSuite) TestServerCommands(c *C) {
}
return ServerStart(args)
},
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc --enable-pprof --metrics-listen-addr=a-server-address:51516 > /dev/null 2>&1 &",
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc --legacy-api --enable-pprof --metrics-listen-addr=a-server-address:51516 > /dev/null 2>&1 &",
},
{
f: func() []string {
Expand All @@ -67,7 +67,7 @@ func (kServer *KopiaServerTestSuite) TestServerCommands(c *C) {
}
return ServerStart(args)
},
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc > /dev/null 2>&1 &",
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc --legacy-api > /dev/null 2>&1 &",
},
{
f: func() []string {
Expand All @@ -83,7 +83,7 @@ func (kServer *KopiaServerTestSuite) TestServerCommands(c *C) {
}
return ServerStart(args)
},
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc",
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --tls-generate-cert --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc --legacy-api",
},
{
f: func() []string {
Expand All @@ -99,7 +99,7 @@ func (kServer *KopiaServerTestSuite) TestServerCommands(c *C) {
}
return ServerStart(args)
},
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc > /dev/null 2>&1 &",
expectedLog: "bash -o errexit -c kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log server start --address=a-server-address --tls-cert-file=/path/to/cert/tls.crt --tls-key-file=/path/to/key/tls.key --server-username=a-username@a-hostname --server-password=a-user-password --server-control-username=a-username@a-hostname --server-control-password=a-user-password --no-grpc --legacy-api > /dev/null 2>&1 &",
},
{
f: func() []string {
Expand Down

0 comments on commit e288993

Please sign in to comment.