Skip to content

Commit ba840bb

Browse files
committed
Update minio client for testing
Signed-off-by: Victor Chang <[email protected]>
1 parent 46bae3c commit ba840bb

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/Plugins/MinIO/StorageAdminService.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ public StorageAdminService(IOptions<StorageServiceConfiguration> options, ILogge
6161
_accessKey = options.Value.Settings[ConfigurationKeys.AccessKey];
6262
_secretKey = options.Value.Settings[ConfigurationKeys.AccessToken];
6363

64-
SetCommandTemplates(options);
65-
}
66-
67-
private void SetCommandTemplates(IOptions<StorageServiceConfiguration> options)
68-
{
6964
_set_connection_cmd = $"alias set {_serviceName} http://{_endpoint} {_accessKey} {_secretKey}";
7065
_get_connections_cmd = "alias list";
7166
_get_users_cmd = $"admin user list {_serviceName}";
@@ -105,7 +100,7 @@ public async Task<bool> SetPolicyAsync(IdentityType policyType, List<string> pol
105100
var setPolicyCmd = string.Format(CultureInfo.InvariantCulture, _set_policy_cmd, _serviceName, policiesStr, policyType.ToString().ToLowerInvariant(), itemName);
106101
var result = await ExecuteAsync(setPolicyCmd).ConfigureAwait(false);
107102

108-
var expectedResult = $"Policy `{policiesStr}` is set on {policyType.ToString().ToLower()} `{itemName}`";
103+
var expectedResult = $"Attached Policies: [{policiesStr}]";
109104
if (!result.Any(r => r.Contains(expectedResult)))
110105
{
111106
return false;
@@ -274,7 +269,7 @@ private async Task<string> CreatePolicyAsync(PolicyRequest[] policyRequests, str
274269

275270
var policyFileName = await CreatePolicyFile(policyRequests, username).ConfigureAwait(false);
276271
var result = await ExecuteAsync(string.Format(CultureInfo.InvariantCulture, _create_policy_cmd, _serviceName, username, policyFileName)).ConfigureAwait(false);
277-
if (result.Any(r => r.Contains($"Added policy `pol_{username}` successfully.")) is false)
272+
if (result.Any(r => r.Contains($"Created policy `pol_{username}` successfully.")) is false)
278273
{
279274
await RemoveUserAsync(username).ConfigureAwait(false);
280275
File.Delete($"{username}.json");
1.22 MB
Binary file not shown.
1.59 MB
Binary file not shown.

0 commit comments

Comments
 (0)