Skip to content

Commit d0a4dd3

Browse files
committed
Just extract cache host. Remove explicit use of env variables when starting server and client. Add some temporary logging of values.
1 parent 6e5df67 commit d0a4dd3

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

deploy/tasks/buildah-oci-ta.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ spec:
390390
fi
391391
echo "Build will be executed with domain proxy"
392392
echo ${DOMAIN_PROXY_ARGS[@]} # TODO remove
393-
${DOMAIN_PROXY_ARGS[@]} /app/domain-proxy-server-runner & # TODO remove explicit args if unnecessary
393+
/app/domain-proxy-server-runner &
394394
server_pid=$!
395395
fi
396396
fi
@@ -494,11 +494,7 @@ spec:
494494
cat >> /app/build-script.sh << EOF
495495
#!/bin/sh
496496
ip link set lo up
497-
${DOMAIN_PROXY_ARGS[@]} /app/domain-proxy-client-runner & # TODO remove explicit args if unnecessary
498-
EOF
499-
500-
# Without expansion
501-
cat > /app/build-script.sh << 'EOF'
497+
/app/domain-proxy-client-runner &
502498
client_pid=$!
503499
EOF
504500

java-components/domain-proxy/client/src/main/java/com/redhat/hacbs/domainproxy/client/DomainProxyClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class DomainProxyClient {
4141
@PostConstruct
4242
public void start() {
4343
Log.info("Starting domain proxy client...");
44+
Log.infof("Byte buffer size %d", byteBufferSize); // TODO remove
4445
new Thread(() -> {
4546
try (final ServerSocket serverSocket = new ServerSocket(clientHttpPort)) {
4647
while (running) {

java-components/domain-proxy/server/src/main/java/com/redhat/hacbs/domainproxy/DomainProxyServer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class DomainProxyServer {
4545

4646
@PostConstruct
4747
public void start() {
48+
Log.infof("Byte buffer size %d", byteBufferSize); // TODO remove
4849
new Thread(() -> {
4950
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
5051
try {

java-components/domain-proxy/server/src/main/java/com/redhat/hacbs/domainproxy/ExternalProxyVerticle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public ExternalProxyVerticle(final Vertx vertx) {
4848
@Override
4949
public void start() {
5050
Log.info("Starting domain proxy server...");
51+
Log.infof("Proxy target whitelist: %s", proxyTargetWhitelist); // TODO remove
5152
httpServer.requestHandler(request -> {
5253
if (request.method() == HttpMethod.GET) {
5354
handleGetRequest(request);

pkg/reconciler/dependencybuild/buildrecipeyaml.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"github.com/go-logr/logr"
88
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
9+
"net/url"
910
"regexp"
1011
"strconv"
1112
"strings"
@@ -477,6 +478,10 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
477478
},
478479
}
479480

481+
whitelistUrl, err := url.Parse(cacheUrl)
482+
if err != nil {
483+
return nil, "", err
484+
}
480485
ps.Tasks = append([]tektonpipeline.PipelineTask{
481486
{
482487
Name: BuildTaskName,
@@ -548,14 +553,14 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
548553
Name: "BYTE_BUFFER_SIZE", // TODO remove
549554
Value: tektonpipeline.ParamValue{
550555
Type: tektonpipeline.ParamTypeString,
551-
StringVal: "1024",
556+
StringVal: "2048",
552557
},
553558
},
554559
{
555560
Name: "PROXY_TARGET_WHITELIST",
556561
Value: tektonpipeline.ParamValue{
557562
Type: tektonpipeline.ParamTypeString,
558-
StringVal: cacheUrl,
563+
StringVal: whitelistUrl.Host,
559564
},
560565
},
561566
},

0 commit comments

Comments
 (0)