From 9ddcd1b5b903bc844aef181c2946162992d0fe29 Mon Sep 17 00:00:00 2001 From: Andy Zhang <87735571+Andyz26@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:27:28 -0800 Subject: [PATCH] fix https jar url (#743) --- .../jobcluster/proto/JobClusterManagerProto.java | 2 +- .../mantisrx/master/jobcluster/JobClusterAkkaTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java index 91bf59906..6612b9c79 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java +++ b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/jobcluster/proto/JobClusterManagerProto.java @@ -557,7 +557,7 @@ public UpdateJobClusterArtifactRequest( // json property "url". this.jobJarUrl = jobJarUrl != null ? jobJarUrl : - (artifact.startsWith("http://") ? artifact : "http://" + artifact); + (artifact.startsWith("http://") || artifact.startsWith("https://") ? artifact : "http://" + artifact); this.version = version; this.skipSubmit = skipSubmit; this.user = user; diff --git a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java index c04096a8f..f9dad2467 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java +++ b/mantis-control-plane/mantis-control-plane-server/src/test/java/io/mantisrx/master/jobcluster/JobClusterAkkaTest.java @@ -811,6 +811,16 @@ public void testJobClusterArtifactUpdateBackCompat() throws Exception { "user"); assertEquals("artifact1-1.zip", req2.getArtifactName()); assertEquals("http://artifact1-1.zip", req2.getjobJarUrl()); + + UpdateJobClusterArtifactRequest req3 = new UpdateJobClusterArtifactRequest( + clusterName, + "https://path1/artifact1-1.zip", + null, + "1", + true, + "user"); + assertEquals("https://path1/artifact1-1.zip", req3.getArtifactName()); + assertEquals("https://path1/artifact1-1.zip", req3.getjobJarUrl()); } @Test