Fix garage mc not getting default secret key set correctly
This commit is contained in:
parent
739e88d6c9
commit
b1fa3be970
@ -36,15 +36,12 @@ var subCmdGarageMC = subCmd{
|
|||||||
|
|
||||||
s3APIAddr := hostBootstrap.ChooseGaragePeer().S3APIAddr()
|
s3APIAddr := hostBootstrap.ChooseGaragePeer().S3APIAddr()
|
||||||
|
|
||||||
if *keyID == "" || *keySecret == "" {
|
|
||||||
|
|
||||||
if *keyID == "" {
|
if *keyID == "" {
|
||||||
*keyID = hostBootstrap.Garage.GlobalBucketS3APICredentials.ID
|
*keyID = hostBootstrap.Garage.GlobalBucketS3APICredentials.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
if *keySecret == "" {
|
if *keySecret == "" {
|
||||||
*keyID = hostBootstrap.Garage.GlobalBucketS3APICredentials.Secret
|
*keySecret = hostBootstrap.Garage.GlobalBucketS3APICredentials.Secret
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
args := flags.Args()
|
args := flags.Args()
|
||||||
@ -56,13 +53,15 @@ var subCmdGarageMC = subCmd{
|
|||||||
args = append([]string{"mc"}, args...)
|
args = append([]string{"mc"}, args...)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
mcHostVar = fmt.Sprintf(
|
||||||
|
"MC_HOST_garage=http://%s:%s@%s",
|
||||||
|
*keyID, *keySecret, s3APIAddr,
|
||||||
|
)
|
||||||
|
|
||||||
binPath = filepath.Join(envAppDirPath, "bin/mc")
|
binPath = filepath.Join(envAppDirPath, "bin/mc")
|
||||||
cliEnv = append(
|
cliEnv = append(
|
||||||
os.Environ(),
|
os.Environ(),
|
||||||
fmt.Sprintf(
|
mcHostVar,
|
||||||
"MC_HOST_garage=http://%s:%s@%s",
|
|
||||||
*keyID, *keySecret, s3APIAddr,
|
|
||||||
),
|
|
||||||
|
|
||||||
// The garage docs say this is necessary, though nothing bad
|
// The garage docs say this is necessary, though nothing bad
|
||||||
// seems to happen if we leave it out *shrug*
|
// seems to happen if we leave it out *shrug*
|
||||||
|
Loading…
Reference in New Issue
Block a user