mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 08:13:28 +03:00
server: Introduce a new env MINIO_REGION. (#4078)
This is implemented to be able to override region through command line just like how access and secret keys are provided.
This commit is contained in:
+10
-4
@@ -138,10 +138,10 @@ func TestServerConfigWithEnvs(t *testing.T) {
|
||||
os.Setenv("MINIO_SECRET_KEY", "minio123")
|
||||
defer os.Unsetenv("MINIO_SECRET_KEY")
|
||||
|
||||
defer func() {
|
||||
globalIsEnvBrowser = false
|
||||
globalIsEnvCreds = false
|
||||
}()
|
||||
os.Setenv("MINIO_REGION", "us-west-1")
|
||||
defer os.Unsetenv("MINIO_REGION")
|
||||
|
||||
defer resetGlobalIsEnvs()
|
||||
|
||||
// Get test root.
|
||||
rootPath, err := getTestRoot()
|
||||
@@ -165,6 +165,11 @@ func TestServerConfigWithEnvs(t *testing.T) {
|
||||
t.Errorf("Expecting browser is set to false found %v", serverConfig.GetBrowser())
|
||||
}
|
||||
|
||||
// Check if serverConfig has
|
||||
if serverConfig.GetRegion() != "us-west-1" {
|
||||
t.Errorf("Expecting region to be \"us-west-1\" found %v", serverConfig.GetRegion())
|
||||
}
|
||||
|
||||
// Check if serverConfig has
|
||||
cred := serverConfig.GetCredential()
|
||||
|
||||
@@ -175,6 +180,7 @@ func TestServerConfigWithEnvs(t *testing.T) {
|
||||
if cred.SecretKey != "minio123" {
|
||||
t.Errorf("Expecting access key to be `minio123` found %s", cred.SecretKey)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestCheckDupJSONKeys(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user