mirror of
https://github.com/minio/minio.git
synced 2025-02-03 01:46:00 -05:00
parent
d96798ae7b
commit
3b1aa40372
@ -26,6 +26,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
@ -254,6 +255,13 @@ func Connect(ctx context.Context, opts *ConnectionOptions) (*KMS, error) {
|
||||
var s string
|
||||
if lookup(EnvKMSSecretKeyFile) {
|
||||
b, err := os.ReadFile(env.Get(EnvKMSSecretKeyFile, ""))
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
if os.IsNotExist(err) {
|
||||
// Relative path where "/run/secrets" is the default docker path for secrets
|
||||
b, err = os.ReadFile(filepath.Join("/run/secrets", env.Get(EnvKMSSecretKeyFile, "")))
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user