remove s3 region to be mandatory and fix when user call test s3 when the config is saved (#8454)
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
caf9c24099
Коммит
db4402c40d
@@ -497,7 +497,7 @@ func TestS3TestConnection(t *testing.T) {
|
||||
AmazonS3AccessKeyId: model.MINIO_ACCESS_KEY,
|
||||
AmazonS3SecretAccessKey: model.MINIO_SECRET_KEY,
|
||||
AmazonS3Bucket: "",
|
||||
AmazonS3Endpoint: "",
|
||||
AmazonS3Endpoint: s3Endpoint,
|
||||
AmazonS3SSL: model.NewBool(false),
|
||||
},
|
||||
}
|
||||
@@ -512,23 +512,14 @@ func TestS3TestConnection(t *testing.T) {
|
||||
}
|
||||
|
||||
config.FileSettings.AmazonS3Bucket = model.MINIO_BUCKET
|
||||
_, resp = th.SystemAdminClient.TestS3Connection(&config)
|
||||
CheckBadRequestStatus(t, resp)
|
||||
if resp.Error.Message != "S3 Endpoint is required" {
|
||||
t.Fatal("should return error - missing s3 endpoint")
|
||||
}
|
||||
|
||||
config.FileSettings.AmazonS3Endpoint = s3Endpoint
|
||||
_, resp = th.SystemAdminClient.TestS3Connection(&config)
|
||||
CheckBadRequestStatus(t, resp)
|
||||
if resp.Error.Message != "S3 Region is required" {
|
||||
t.Fatal("should return error - missing s3 region")
|
||||
}
|
||||
|
||||
config.FileSettings.AmazonS3Region = "us-east-1"
|
||||
_, resp = th.SystemAdminClient.TestS3Connection(&config)
|
||||
CheckOKStatus(t, resp)
|
||||
|
||||
config.FileSettings.AmazonS3Region = ""
|
||||
_, resp = th.SystemAdminClient.TestS3Connection(&config)
|
||||
CheckOKStatus(t, resp)
|
||||
|
||||
config.FileSettings.AmazonS3Bucket = "Wrong_bucket"
|
||||
_, resp = th.SystemAdminClient.TestS3Connection(&config)
|
||||
CheckInternalErrorStatus(t, resp)
|
||||
|
||||
Ссылка в новой задаче
Block a user