umamaheswararao commented on code in PR #4524:
URL: https://github.com/apache/ozone/pull/4524#discussion_r1157764235
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java:
##########
@@ -127,17 +127,25 @@ private static void doNameChecks(String resName) {
}
}
- private static boolean isSupportedCharacter(char c) {
- return (c == '.' || c == '-' ||
- Character.isLowerCase(c) || Character.isDigit(c));
+ private static boolean isSupportedCharacter(char c, boolean
isNamespaceS3RuleCompliant) {
+ if (isNamespaceS3RuleCompliant) {
+ return (c == '.' || c == '-' ||
+ Character.isLowerCase(c) || Character.isDigit(c));
+ } else {
+ // allow ozone namespace to follow other volume/bucket naming convention,
Review Comment:
can you put char '_' instead?
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -210,6 +211,19 @@ public void
testValidateAndUpdateCacheBucketWithNoQuotaWhenVolumeQuotaSet()
OMException.ResultCodes.QUOTA_ERROR.toString());
}
+ @Test
+ public void testCreateBucketWithOMConfigNonS3RuleCompliantSetToFalse()
throws Exception {
Review Comment:
You may want to add some tests enabling the flag and disabling the flag?
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -210,6 +211,19 @@ public void
testValidateAndUpdateCacheBucketWithNoQuotaWhenVolumeQuotaSet()
OMException.ResultCodes.QUOTA_ERROR.toString());
}
+ @Test
+ public void testCreateBucketWithOMConfigNonS3RuleCompliantSetToFalse()
throws Exception {
Review Comment:
Could you please add couple more tests like starts with _, end with _ and
multiple _s etc? Probably you can parameterize.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]