Skip to content

Commit

Permalink
fix: curl was upgraded in alpine. Correct way of interpreting a skill…
Browse files Browse the repository at this point in the history
… request body.
  • Loading branch information
drcgjung committed Jul 25, 2024
1 parent 34f9431 commit b4371e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okio.Buffer;
import org.eclipse.edc.connector.dataplane.http.params.HttpRequestFactory;
import org.eclipse.edc.connector.dataplane.http.spi.HttpRequestParams;
import org.eclipse.edc.connector.dataplane.spi.pipeline.DataSource;
Expand Down Expand Up @@ -137,10 +138,12 @@ protected StreamResult<Stream<Part>> openMatchmakingInternal() {
}
String query = skillText.get();
okhttp3.Request tempRequest = this.requestFactory.toRequest(this.params);
if (tempRequest.body() != null && tempRequest.body().contentType().toString() == AgentHttpAction.RESULTSET_CONTENT_TYPE) {
if (tempRequest.body() != null && AgentHttpAction.RESULTSET_CONTENT_TYPE.equals(tempRequest.body().contentType().toString())) {
TupleSet bindings = new TupleSet();
try {
AgentHttpAction.parseBinding(typeManager.getMapper().readTree(tempRequest.body().toString()), bindings);
Buffer buffer = new Buffer();
tempRequest.body().writeTo(buffer);
AgentHttpAction.parseBinding(typeManager.getMapper().readTree(buffer.readByteArray()), bindings);
query = AgentHttpAction.bind(query, bindings);
} catch (Exception e) {
return StreamResult.error(String.format("The query could not be bound to the given input tupleset.", e));
Expand Down Expand Up @@ -219,10 +222,12 @@ protected StreamResult<Stream<Part>> openMatchmakingRest() {
}
String query = skillText.get();
okhttp3.Request tempRequest = this.requestFactory.toRequest(this.params);
if (tempRequest.body() != null && tempRequest.body().contentType().toString() == AgentHttpAction.RESULTSET_CONTENT_TYPE) {
if (tempRequest.body() != null && AgentHttpAction.RESULTSET_CONTENT_TYPE.equals(tempRequest.body().contentType().toString())) {
TupleSet bindings = new TupleSet();
try {
AgentHttpAction.parseBinding(typeManager.getMapper().readTree(tempRequest.body().toString()), bindings);
Buffer buffer = new Buffer();
tempRequest.body().writeTo(buffer);
AgentHttpAction.parseBinding(typeManager.getMapper().readTree(buffer.readByteArray()), bindings);
query = AgentHttpAction.bind(query, bindings);
} catch (Exception e) {
return StreamResult.error(String.format("The query could not be bound to the given input tupleset.", e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.5.0-r0 --no-cache
RUN apk update && apk add curl=8.9.0-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:22-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.5.0-r0 --no-cache
RUN apk update && apk add curl=8.9.0-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:22-jre-alpine
Expand Down

0 comments on commit b4371e4

Please sign in to comment.