Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: Don't end status with '.' in XdsNameResolver (1.45.x backport) #8965

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions xds/src/main/java/io/grpc/xds/XdsNameResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ public void run() {
return;
}
listener.onError(Status.UNAVAILABLE.withCause(error.getCause()).withDescription(
String.format("Unable to load LDS %s. xDS server returned: %s: %s.",
String.format("Unable to load LDS %s. xDS server returned: %s: %s",
ldsResourceName, error.getCode(), error.getDescription())));
}
});
Expand Down Expand Up @@ -923,7 +923,7 @@ public void run() {
return;
}
listener.onError(Status.UNAVAILABLE.withCause(error.getCause()).withDescription(
String.format("Unable to load RDS %s. xDS server returned: %s: %s.",
String.format("Unable to load RDS %s. xDS server returned: %s: %s",
resourceName, error.getCode(), error.getDescription())));
}
});
Expand Down
8 changes: 4 additions & 4 deletions xds/src/test/java/io/grpc/xds/XdsNameResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public void resolving_encounterErrorLdsWatcherOnly() {
Status error = errorCaptor.getValue();
assertThat(error.getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(error.getDescription()).isEqualTo("Unable to load LDS " + AUTHORITY
+ ". xDS server returned: UNAVAILABLE: server unreachable.");
+ ". xDS server returned: UNAVAILABLE: server unreachable");
}

@Test
Expand All @@ -444,7 +444,7 @@ public void resolving_translateErrorLds() {
Status error = errorCaptor.getValue();
assertThat(error.getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(error.getDescription()).isEqualTo("Unable to load LDS " + AUTHORITY
+ ". xDS server returned: NOT_FOUND: server unreachable.");
+ ". xDS server returned: NOT_FOUND: server unreachable");
assertThat(error.getCause()).isNull();
}

Expand All @@ -458,11 +458,11 @@ public void resolving_encounterErrorLdsAndRdsWatchers() {
Status error = errorCaptor.getAllValues().get(0);
assertThat(error.getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(error.getDescription()).isEqualTo("Unable to load LDS " + AUTHORITY
+ ". xDS server returned: UNAVAILABLE: server unreachable.");
+ ". xDS server returned: UNAVAILABLE: server unreachable");
error = errorCaptor.getAllValues().get(1);
assertThat(error.getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(error.getDescription()).isEqualTo("Unable to load RDS " + RDS_RESOURCE_NAME
+ ". xDS server returned: UNAVAILABLE: server unreachable.");
+ ". xDS server returned: UNAVAILABLE: server unreachable");
}

@Test
Expand Down