Skip to content

Commit

Permalink
Use getSdkVersion()
Browse files Browse the repository at this point in the history
  • Loading branch information
addjuarez committed Nov 18, 2022
1 parent 4dedc3f commit 29716b2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static ManagedChannel buildManagedChannel(DaprApiProtocol apiProtocol) {

return ManagedChannelBuilder.forAddress(Properties.SIDECAR_IP.get(), port)
.usePlaintext()
.userAgent(Version.getVersion())
.userAgent(Version.getSdkVersion())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private static ManagedChannel buildManagedChannel() {

return ManagedChannelBuilder.forAddress(Properties.SIDECAR_IP.get(), port)
.usePlaintext()
.userAgent(Version.getVersion())
.userAgent(Version.getSdkVersion())
.build();
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/dapr/client/DaprClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private DaprClient buildDaprClientGrpc() {
throw new IllegalArgumentException("Invalid port.");
}
ManagedChannel channel = ManagedChannelBuilder.forAddress(
Properties.SIDECAR_IP.get(), port).usePlaintext().userAgent(Version.getVersion()).build();
Properties.SIDECAR_IP.get(), port).usePlaintext().userAgent(Version.getSdkVersion()).build();
Closeable closeableChannel = () -> {
if (channel != null && !channel.isShutdown()) {
channel.shutdown();
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/dapr/client/DaprHttp.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private CompletableFuture<Response> doInvokeApi(String method,
requestBuilder.addHeader(Headers.DAPR_API_TOKEN, daprApiToken);
}

requestBuilder.addHeader(Headers.DAPR_USER_AGENT, Version.getVersion());
requestBuilder.addHeader(Headers.DAPR_USER_AGENT, Version.getSdkVersion());

if (headers != null) {
Optional.ofNullable(headers.entrySet()).orElse(Collections.emptySet()).stream()
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/dapr/utils/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class Version {
*
* @return String version of sdk.
*/
public static String getVersion() {
public static String getSdkVersion() {

if (sdkVersion != null) {
return sdkVersion;
Expand Down

0 comments on commit 29716b2

Please sign in to comment.