Skip to content

Commit

Permalink
Update mc commands
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp committed Jun 11, 2024
1 parent 2361edd commit dfab00d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ header:
license:
spdx-id: Apache-2.0
copyright-owner: MONAI Consortium
copyright-year: '2021-2024'


paths:
- 'src'
Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/MinIO/StorageAdminService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 MONAI Consortium
* Copyright 2022-2024 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task<bool> SetPolicyAsync(IdentityType policyType, List<string> pol
Guard.Against.NullOrWhiteSpace(itemName, nameof(itemName));

var policiesStr = string.Join(',', policies);
var setPolicyCmd = $"admin policy set {_serviceName} {policiesStr} {policyType.ToString().ToLower()}={itemName}";
var setPolicyCmd = $"admin policy attach {_serviceName} {policiesStr} --{policyType.ToString().ToLower()} {itemName}";
var result = await ExecuteAsync(setPolicyCmd).ConfigureAwait(false);

var expectedResult = $"Policy `{policiesStr}` is set on {policyType.ToString().ToLower()} `{itemName}`";
Expand Down Expand Up @@ -260,7 +260,7 @@ private async Task<string> CreatePolicyAsync(PolicyRequest[] policyRequests, str
Guard.Against.NullOrWhiteSpace(username, nameof(username));

var policyFileName = await CreatePolicyFile(policyRequests, username).ConfigureAwait(false);
var result = await ExecuteAsync($"admin policy add {_serviceName} pol_{username} {policyFileName}").ConfigureAwait(false);
var result = await ExecuteAsync($"admin policy create {_serviceName} pol_{username} {policyFileName}").ConfigureAwait(false);
if (result.Any(r => r.Contains($"Added policy `pol_{username}` successfully.")) is false)
{
await RemoveUserAsync(username).ConfigureAwait(false);
Expand Down

0 comments on commit dfab00d

Please sign in to comment.