upgrade linter and cleanup makefile (#126)

This commit is contained in:
Harshavardhana
2020-05-18 21:55:54 -07:00
committed by GitHub
parent c5b2419191
commit 92a8aab07d
9 changed files with 102 additions and 761 deletions

View File

@@ -28,12 +28,9 @@ import (
"github.com/go-openapi/swag"
"github.com/stretchr/testify/assert"
"github.com/minio/minio/pkg/event/target"
"github.com/minio/minio/cmd/config"
"github.com/minio/mcs/models"
"github.com/minio/minio/cmd/config"
"github.com/minio/minio/pkg/event/target"
"github.com/minio/minio/pkg/madmin"
)
@@ -532,7 +529,7 @@ func Test_getConfig(t *testing.T) {
// mock function response from getConfig()
minioGetConfigKVMock = func(key string) ([]byte, error) {
return nil, errors.New("Invalid config")
return nil, errors.New("invalid config")
}
mockConfigList := madmin.Help{}
@@ -553,7 +550,7 @@ func Test_getConfig(t *testing.T) {
mock: func() {
// mock function response from getConfig()
minioGetConfigKVMock = func(key string) ([]byte, error) {
return nil, errors.New("Invalid config")
return nil, errors.New("invalid config")
}
// mock function response from listConfig()
minioHelpConfigKVMock = func(subSys, key string, envOnly bool) (madmin.Help, error) {

View File

@@ -163,10 +163,10 @@ var STSClient = PrepareSTSClient()
func newMcsCredentials(accessKey, secretKey, location string) (*credentials.Credentials, error) {
mcsEndpoint := getMinIOServer()
if mcsEndpoint == "" {
return nil, errors.New("STS endpoint cannot be empty")
return nil, errors.New("endpoint cannot be empty for AssumeRoleSTS")
}
if accessKey == "" || secretKey == "" {
return nil, errors.New("AssumeRole credentials access/secretkey is mandatory")
return nil, errors.New("creredentials access/secretkey is mandatory for AssumeRoleSTS")
}
// Future authentication methods can be added under this switch statement

View File

@@ -126,7 +126,7 @@ func Test_getConfiguredRegion(t *testing.T) {
mock: func() {
// mock function response from getConfig()
minioGetConfigKVMock = func(key string) ([]byte, error) {
return nil, errors.New("Invalid config")
return nil, errors.New("invalid config")
}
// mock function response from listConfig()
minioHelpConfigKVMock = func(subSys, key string, envOnly bool) (madmin.Help, error) {