Fix random bugs related to using garage cli tools

This commit is contained in:
Brian Picciano 2022-11-08 14:54:31 +01:00
parent c4b7abbcc4
commit 838c548706
2 changed files with 6 additions and 5 deletions

View File

@ -78,6 +78,6 @@ storage:
#- data_path: /foo/bar/data #- data_path: /foo/bar/data
# meta_path: /foo/bar/meta # meta_path: /foo/bar/meta
# capacity: 1200 # capacity: 1200
# #s3_api_port: 3900 # #rpc_port: 3900
# #rpc_port: 3901 # #s3_api_port: 3901
# #admin_port: 3902 # #admin_port: 3902

View File

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"syscall" "syscall"
) )
@ -55,7 +56,7 @@ var subCmdGarageMC = subCmd{
args = append([]string{"mc"}, args...) args = append([]string{"mc"}, args...)
var ( var (
binPath = "mc" binPath = filepath.Join(envAppDirPath, "bin/mc")
cliEnv = append( cliEnv = append(
os.Environ(), os.Environ(),
fmt.Sprintf( fmt.Sprintf(
@ -92,11 +93,11 @@ var subCmdGarageCLI = subCmd{
} }
var ( var (
binPath = "garage" binPath = filepath.Join(envAppDirPath, "bin/garage")
args = append([]string{"garage"}, subCmdCtx.args...) args = append([]string{"garage"}, subCmdCtx.args...)
cliEnv = append( cliEnv = append(
os.Environ(), os.Environ(),
"GARAGE_RPC_HOST="+hostBootstrap.ChooseGaragePeer().RPCAddr(), "GARAGE_RPC_HOST="+hostBootstrap.ChooseGaragePeer().RPCPeerAddr(),
"GARAGE_RPC_SECRET="+hostBootstrap.Garage.RPCSecret, "GARAGE_RPC_SECRET="+hostBootstrap.Garage.RPCSecret,
) )
) )