mirror of
https://github.com/minio/minio.git
synced 2025-11-29 05:19:03 -05:00
Add madmin package context support (#9172)
This is to improve responsiveness for all admin API operations and allowing callers to cancel any on-going admin operations, if they happen to be waiting too long.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
@@ -43,7 +44,7 @@ func main() {
|
||||
// Create policy
|
||||
policy := `{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject"],"Effect": "Allow","Resource": ["arn:aws:s3:::testbucket/*"],"Sid": ""}]}`
|
||||
|
||||
creds, err := madmClnt.AddServiceAccount("parentuser", policy)
|
||||
creds, err := madmClnt.AddServiceAccount(context.Background(), "parentuser", policy)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user