Skip to content

Commit 628240e

Browse files
committed
release 2023-04-28: privatelink report tuning
1 parent a164d4f commit 628240e

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mvn clean install -Phadoop-3.3.2 -Pextra
2828
To publish the release use the gui or the github command line
2929

3030
```bash
31-
set -gx date 2023-03-03
31+
set -gx date 2023-04-28
3232
git add .
3333
git commit -S -m "release $date"
3434
git push

src/main/java/org/apache/hadoop/fs/store/diag/S3ADiagnosticsInfo.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ protected void validateConfig(final Printout printout,
650650
String endpoint = conf.getTrimmed(ENDPOINT, "").toLowerCase(Locale.ROOT);
651651
String region = conf.getTrimmed(REGION, "").toLowerCase(Locale.ROOT);
652652
String bucket = getFsURI().getHost();
653+
boolean privateLink = false;
653654

654655

655656
boolean secureConnections = conf.getBoolean(SECURE_CONNECTIONS,
@@ -660,15 +661,6 @@ protected void validateConfig(final Printout printout,
660661
printout.println("%s = \"%s\"", PATH_STYLE_ACCESS, pathStyleAccess);
661662
printout.println("%s = \"%s\"", SECURE_CONNECTIONS, secureConnections);
662663

663-
if (endpoint.startsWith("https:") || endpoint.startsWith("http:")) {
664-
printout.warn("Value of %s looks like a URL: %s", ENDPOINT, endpoint);
665-
printout.println("It SHOULD normally be a hostname or IP address");
666-
printout.println("Unless you have a private store with a non-standard port or"
667-
+ " are using AWS S3 PrivateLink");
668-
if (!pathStyleAccess) {
669-
printout.warn("You should probably set %s to true", PATH_STYLE_ACCESS);
670-
}
671-
}
672664
boolean isUsingAws = false;
673665
if (endpoint.isEmpty()) {
674666
isUsingAws = true;
@@ -680,11 +672,12 @@ protected void validateConfig(final Printout printout,
680672
+ " tune " + PATH_STYLE_ACCESS
681673
+ " and " + SECURE_CONNECTIONS + " as appropriate");
682674
}
683-
} else if (endpoint.endsWith("amazonaws.cn")) {
675+
} else if (endpoint.endsWith("amazonaws.cn") || endpoint.endsWith("amazonaws.cn/")) {
684676
isUsingAws = true;
685677
printout.println("AWS china is in use");
686-
} else if (endpoint.endsWith(".vpce.amazonaws.com")) {
678+
} else if (endpoint.endsWith(".vpce.amazonaws.com") || endpoint.endsWith(".vpce.amazonaws.com/")) {
687679
isUsingAws = true;
680+
privateLink = true;
688681
printout.println("AWS VPCE is being used for a VPN connection to S3");
689682
printout.warn("you MUST set %s to the region of this store; it is currently \"%s\"",
690683
REGION, region);
@@ -721,7 +714,17 @@ protected void validateConfig(final Printout printout,
721714
}
722715

723716
}
724-
if (isUsingAws) {
717+
718+
if (!privateLink && (endpoint.startsWith("https:") || endpoint.startsWith("http:"))) {
719+
printout.warn("Value of %s looks like a URL: %s", ENDPOINT, endpoint);
720+
printout.println("It SHOULD normally be a hostname or IP address");
721+
printout.println("Unless you have a private store with a non-standard port or"
722+
+ " are using AWS S3 PrivateLink");
723+
if (!pathStyleAccess) {
724+
printout.warn("You should probably set %s to true", PATH_STYLE_ACCESS);
725+
}
726+
}
727+
if (!privateLink && isUsingAws) {
725728
printout.println("Important: if you are working with a third party store,");
726729
printout.println(" this client is still trying to connect to to AWS S3");
727730
printout.println("Expect failure until %s is set to the private endpoint", ENDPOINT);

0 commit comments

Comments
 (0)