mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
use context specific to the etcd call (#9458)
This commit is contained in:
parent
6ecc98fddb
commit
f216670814
@ -21,6 +21,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
etcd "github.com/coreos/etcd/clientv3"
|
etcd "github.com/coreos/etcd/clientv3"
|
||||||
@ -163,9 +164,6 @@ func decryptData(edata []byte, creds ...auth.Credentials) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func migrateIAMConfigsEtcdToEncrypted(ctx context.Context, client *etcd.Client) error {
|
func migrateIAMConfigsEtcdToEncrypted(ctx context.Context, client *etcd.Client) error {
|
||||||
ctx, cancel := context.WithTimeout(ctx, defaultContextTimeout)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
encrypted, err := checkBackendEtcdEncrypted(ctx, client)
|
encrypted, err := checkBackendEtcdEncrypted(ctx, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -206,7 +204,10 @@ func migrateIAMConfigsEtcdToEncrypted(ctx context.Context, client *etcd.Client)
|
|||||||
logger.Info("Attempting encryption of all IAM users and policies on etcd")
|
logger.Info("Attempting encryption of all IAM users and policies on etcd")
|
||||||
}
|
}
|
||||||
|
|
||||||
r, err := client.Get(ctx, minioConfigPrefix, etcd.WithPrefix(), etcd.WithKeysOnly())
|
listCtx, cancel := context.WithTimeout(ctx, 1*time.Minute)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
r, err := client.Get(listCtx, minioConfigPrefix, etcd.WithPrefix(), etcd.WithKeysOnly())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user