From 367ca3c5900d2adefeba90f539afd5085a8e59c1 Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Mon, 15 Jan 2024 14:00:42 -0500 Subject: [PATCH] :ghost: make bundles location a config setting Signed-off-by: Pranav Gaikwad --- cmd/analyze.go | 6 +++--- cmd/settings.go | 1 + hack/update-settings.sh | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/analyze.go b/cmd/analyze.go index 58360fe..a68088d 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -417,7 +417,7 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) { Location: SourceMountPath, AnalysisMode: provider.AnalysisMode(a.mode), ProviderSpecificConfig: map[string]interface{}{ - "bundles": "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar", + "bundles": JavaBundlesLocation, "depOpenSourceLabelsFile": "/usr/local/etc/maven.default.index", provider.LspServerPathConfigKey: "/jdtls/bin/jdtls", }, @@ -468,9 +468,9 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) { // Set proxy to providers if a.httpProxy != "" || a.httpsProxy != "" { proxy := provider.Proxy{ - HTTPProxy: a.httpProxy, + HTTPProxy: a.httpProxy, HTTPSProxy: a.httpsProxy, - NoProxy: a.noProxy, + NoProxy: a.noProxy, } for i := range provConfig { provConfig[i].Proxy = &proxy diff --git a/cmd/settings.go b/cmd/settings.go index e234bb9..978375e 100644 --- a/cmd/settings.go +++ b/cmd/settings.go @@ -18,6 +18,7 @@ const ( XMLRulePath = "/opt/xmlrules" ShimOutputPath = "/opt/shimoutput" CustomRulePath = "/opt/input/rules" + JavaBundlesLocation = "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar" ) type Config struct { diff --git a/hack/update-settings.sh b/hack/update-settings.sh index 6a98349..22bc226 100755 --- a/hack/update-settings.sh +++ b/hack/update-settings.sh @@ -5,8 +5,10 @@ image="${IMAGE:-quay.io/konveyor/kantra}" name="${NAME:-kantra}" +bundle="${BUNDLE:-/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar}" sed -i \ -e "s,\(RootCommandName *string.*default:\"\)[^\"]*\",\1$name\"," \ -e "s,\(RunnerImage *string.*default:\"\)[^\"]*\",\1$image\"," \ + -e "s,\(JavaBundlesLocation *= *\"\)[^\"]*\",\1$bundle\"," \ ./cmd/settings.go