diff --git a/cmd/erasure-healing_test.go b/cmd/erasure-healing_test.go index 27151fcef..153c3529e 100644 --- a/cmd/erasure-healing_test.go +++ b/cmd/erasure-healing_test.go @@ -1645,7 +1645,6 @@ func TestHealLastDataShard(t *testing.T) { _, err = obj.PutObject(ctx, bucket, object, mustGetPutObjReader(t, bytes.NewReader(data), int64(len(data)), "", ""), opts) - if err != nil { t.Fatal(err) } diff --git a/cmd/iam.go b/cmd/iam.go index edcb9e77f..c18db6f78 100644 --- a/cmd/iam.go +++ b/cmd/iam.go @@ -270,16 +270,13 @@ func (sys *IAMSys) Init(ctx context.Context, objAPI ObjectLayer, etcdClient *etc setGlobalAuthZPlugin(polplugin.New(authZPluginCfg)) sys.Lock() - defer sys.Unlock() - sys.LDAPConfig = ldapConfig sys.OpenIDConfig = openidConfig sys.STSTLSConfig = stsTLSConfig - sys.iamRefreshInterval = iamRefreshInterval - // Initialize IAM store sys.initStore(objAPI, etcdClient) + sys.Unlock() retryCtx, cancel := context.WithCancel(ctx) diff --git a/cmd/object-handlers_test.go b/cmd/object-handlers_test.go index 3ea09720e..6cc624a9d 100644 --- a/cmd/object-handlers_test.go +++ b/cmd/object-handlers_test.go @@ -1581,7 +1581,6 @@ func testAPIPutObjectHandler(obj ObjectLayer, instanceType, bucketName string, a // construct HTTP request for PUT Object endpoint. reqV2, err = newTestSignedRequestV2(http.MethodPut, getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey, testCase.headers) - if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for PutObject: %v", i, instanceType, err) } @@ -2432,7 +2431,6 @@ func testAPICopyObjectHandler(obj ObjectLayer, instanceType, bucketName string, // construct HTTP request for copy object. req, err = newTestSignedRequestV4(http.MethodPut, getCopyObjectURL("", testCase.bucketName, testCase.newObjectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) - if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for copy Object: %v", i, err) } @@ -2534,7 +2532,6 @@ func testAPICopyObjectHandler(obj ObjectLayer, instanceType, bucketName string, } err = signRequestV2(reqV2, testCase.accessKey, testCase.secretKey) - if err != nil { t.Fatalf("Failed to V2 Sign the HTTP request: %v.", err) } @@ -2624,7 +2621,6 @@ func testAPINewMultipartHandler(obj ObjectLayer, instanceType, bucketName string // Setting an invalid accessID. req, err = newTestSignedRequestV4(http.MethodPost, getNewMultipartURL("", bucketName, objectName), 0, nil, "Invalid-AccessID", credentials.SecretKey, nil) - if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: %v", err) } @@ -2675,7 +2671,6 @@ func testAPINewMultipartHandler(obj ObjectLayer, instanceType, bucketName string // Setting invalid AccessID. reqV2, err = newTestSignedRequestV2(http.MethodPost, getNewMultipartURL("", bucketName, objectName), 0, nil, "Invalid-AccessID", credentials.SecretKey, nil) - if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: %v", err) } @@ -3407,7 +3402,6 @@ func testAPIDeleteObjectHandler(obj ObjectLayer, instanceType, bucketName string // construct HTTP request for Delete Object end point. req, err = newTestSignedRequestV4(http.MethodDelete, getDeleteObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) - if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for Delete Object: %v", i+1, err) } @@ -3425,7 +3419,6 @@ func testAPIDeleteObjectHandler(obj ObjectLayer, instanceType, bucketName string // construct HTTP request for Delete Object endpoint. reqV2, err = newTestSignedRequestV2(http.MethodDelete, getDeleteObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) - if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: %v", err) } @@ -3518,7 +3511,6 @@ func testAPIPutObjectPartHandlerStreaming(obj ObjectLayer, instanceType, bucketN req, err = newTestStreamingSignedRequest(http.MethodPut, getPutObjectPartURL("", bucketName, testObject, mpartResp.UploadID, "1"), 5, 1, bytes.NewReader([]byte("hello")), credentials.AccessKey, credentials.SecretKey) - if err != nil { t.Fatalf("Failed to create new streaming signed HTTP request: %v.", err) } @@ -3754,7 +3746,6 @@ func testAPIPutObjectPartHandler(obj ObjectLayer, instanceType, bucketName strin reqV2, err = newTestSignedRequestV2(http.MethodPut, getPutObjectPartURL("", bucketName, test.objectName, uploadID, test.partNumber), int64(len(test.content)), bytes.NewReader([]byte(test.content)), test.accessKey, test.secretKey, nil) - if err != nil { t.Fatalf("Test %d %s Failed to create a V2 signed request to upload part for %s/%s: %v", i, instanceType, bucketName, test.objectName, err) @@ -4075,7 +4066,6 @@ func testAPIListObjectPartsHandler(obj ObjectLayer, instanceType, bucketName str reqV4, err = newTestSignedRequestV4(http.MethodGet, getListMultipartURLWithParams("", bucketName, testObject, uploadID, test.maxParts, test.partNumberMarker, ""), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) - if err != nil { t.Fatalf("Failed to create a V4 signed request to list object parts for %s/%s: %v.", bucketName, testObject, err) @@ -4085,7 +4075,6 @@ func testAPIListObjectPartsHandler(obj ObjectLayer, instanceType, bucketName str reqV2, err = newTestSignedRequestV2(http.MethodGet, getListMultipartURLWithParams("", bucketName, testObject, uploadID, test.maxParts, test.partNumberMarker, ""), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) - if err != nil { t.Fatalf("Failed to create a V2 signed request to list object parts for %s/%s: %v.", bucketName, testObject, err) diff --git a/cmd/object_api_suite_test.go b/cmd/object_api_suite_test.go index a88add526..0173173c8 100644 --- a/cmd/object_api_suite_test.go +++ b/cmd/object_api_suite_test.go @@ -825,7 +825,6 @@ func testGetDirectoryReturnsObjectNotFound(obj ObjectLayer, instanceType string, length := int64(len(content)) var opts ObjectOptions _, err = obj.PutObject(context.Background(), bucketName, "dir1/dir3/object", mustGetPutObjReader(t, bytes.NewBufferString(content), length, "", ""), opts) - if err != nil { t.Fatalf("%s: %s", instanceType, err) }