You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/06/22 07:05:45 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #4953: HDDS-6814. ozone s3 getsecret default --om-service-id

adoroszlai commented on code in PR #4953:
URL: https://github.com/apache/ozone/pull/4953#discussion_r1238090958


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java:
##########
@@ -200,12 +200,22 @@ public OzoneClient createClientForS3Commands(
     } else {
       // If om service id is not specified, consider it as a non-HA cluster.
       // But before that check if serviceId is defined. If it is defined
-      // throw an error om service ID needs to be specified.
+      // and has length = 1, then take that ID as default.
+      // otherwise throw an error om service ID needs to be specified.
       if (OmUtils.isServiceIdsDefined(conf)) {
-        throw new OzoneClientException("Service ID must not"
-            + " be omitted when " + OZONE_OM_SERVICE_IDS_KEY + " is defined. " +
-            "Configured " + OZONE_OM_SERVICE_IDS_KEY + " are " +
-            conf.getTrimmedStringCollection(OZONE_OM_SERVICE_IDS_KEY));
+        Collection<String> serviceIds=conf.
+            getTrimmedStringCollection(OZONE_OM_SERVICE_IDS_KEY);
+        if (serviceIds.size() == 1) {

Review Comment:
   I think that's exactly the purpose: if there are multiple OM services, we should not pick one randomly here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org