From 40ec3e392e5333e8b63dedea0c173231652ab541 Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Tue, 21 Nov 2023 15:07:18 +0000 Subject: [PATCH 1/3] Add logging. Fix project naming in gitlab. Handle PKIX issues. --- .../container/analyser/deploy/DeployCommand.java | 1 + .../hacbs/container/analyser/deploy/git/Git.java | 7 +++++-- .../container/analyser/deploy/git/GitHub.java | 10 ++++++++++ .../container/analyser/deploy/git/GitLab.java | 13 +++++++++++++ .../mavenrepository/MavenRepositoryDeployer.java | 2 ++ .../container/analyser/deploy/git/GitTest.java | 14 +++++++++++--- 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java index c29ab9858..101802da5 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java @@ -155,6 +155,7 @@ public void run() { try { // Save the source first regardless of deployment checks if (isNotEmpty(gitIdentity) && gitToken.isPresent()) { + Log.infof("Git credentials are identity '%s' and URL '%s'", gitIdentity, gitURL); var git = Git.builder(gitURL, gitIdentity, gitToken.get()); git.create(scmUri); git.add(sourcePath, commit, imageId); diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java index b70f6684b..b926a127a 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java @@ -61,6 +61,7 @@ protected void pushRepository(Path path, String httpTransportUrl, String commit, Log.infof("Updating current origin of %s to %s", jConfig.getString("remote", "origin", "url"), httpTransportUrl); jConfig.setString("remote", "origin", "url", httpTransportUrl); + jConfig.setBoolean("http", null, "sslVerify", false); jConfig.save(); Log.infof("Pushing to %s with content from %s (branch %s, commit %s, tag %s)", httpTransportUrl, path, jRepo.getBranch(), commit, tagName); @@ -97,11 +98,13 @@ protected void pushRepository(Path path, String httpTransportUrl, String commit, * @return a reformatted name to use as the new repository name. * @throws URISyntaxException if an error occurs. */ - protected static String parseScmURI(String scmUri) + protected String parseScmURI(String scmUri) throws URISyntaxException { String path = new URI(scmUri).getPath().substring(1); String group = path.substring(0, path.lastIndexOf("/")); String name = (path.endsWith(".git") ? path.substring(0, path.length() - 4) : path).substring(group.length() + 1); - return group + "--" + name; + return group + groupSplit() + name; } + + abstract String groupSplit(); } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java index ded42ed24..ff8198085 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java @@ -49,6 +49,11 @@ public GitHub(String endpoint, String identity, String token) Log.infof("Type %s", type); } + GitHub() { + owner = null; + github = null; + } + @Override public void create(String scmUri) throws IOException, URISyntaxException { @@ -85,4 +90,9 @@ public void add(Path path, String commit, String imageId) { } pushRepository(path, repository.getHttpTransportUrl(), commit, imageId); } + + @Override + String groupSplit() { + return "--"; + } } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java index 6624e55e4..58cf2216b 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java @@ -24,12 +24,20 @@ public GitLab(String endpoint, String identity, String token) { gitLabApi = new GitLabApi(endpoint, token); owner = identity; credentialsProvider = new UsernamePasswordCredentialsProvider("", token); + + gitLabApi.setIgnoreCertificateErrors(true); + } + + GitLab() { + owner = null; + gitLabApi = null; } @Override public void create(String scmUri) throws URISyntaxException { String name = parseScmURI(scmUri); + Log.infof("Creating repository with name %s", name); try { project = gitLabApi.getProjectApi().getUserProjectsStream(owner, new ProjectFilter().withSearch(name)) .filter(p -> p.getName().equals(name)) @@ -62,4 +70,9 @@ public void add(Path path, String commit, String imageId) } pushRepository(path, project.getHttpUrlToRepo(), commit, imageId); } + + @Override + String groupSplit() { + return "-"; + } } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/mavenrepository/MavenRepositoryDeployer.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/mavenrepository/MavenRepositoryDeployer.java index 08d87c127..aa17eb66e 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/mavenrepository/MavenRepositoryDeployer.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/mavenrepository/MavenRepositoryDeployer.java @@ -49,6 +49,8 @@ public MavenRepositoryDeployer(BootstrapMavenContext mvnCtx, String username, St this.system = mvnCtx.getRepositorySystem(); this.session = MavenRepositorySystemUtils.newSession(); + Log.infof("Maven credentials are username '%s' and repository '%s'", username, repository); + // https://maven.apache.org/resolver/third-party-integrations.html states a local repository manager should be added. session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, new LocalRepository(artifacts.toFile()))); } diff --git a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java index 590210392..56afb4cc7 100644 --- a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java +++ b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java @@ -37,12 +37,15 @@ public void clearLogs() { @Test public void parseScmURI() throws URISyntaxException { - String result = Git.parseScmURI("https://github.com/apache/commons-codec.git"); + + String result = new GitHub().parseScmURI("https://github.com/apache/commons-codec.git"); assertEquals("apache--commons-codec", result); - result = Git.parseScmURI("https://gitlab.com/rnc/testRepo"); + result = new GitHub().parseScmURI("https://gitlab.com/rnc/testRepo"); assertEquals("rnc--testRepo", result); - result = Git.parseScmURI("file:///rnc/testRepo"); + result = new GitHub().parseScmURI("file:///rnc/testRepo"); assertEquals("rnc--testRepo", result); + result = new GitLab().parseScmURI("https://gitlab.com/rnc/testRepo"); + assertEquals("rnc-testRepo", result); } @Test @@ -73,6 +76,11 @@ public void create(String name) { @Override public void add(Path path, String commit, String imageId) { } + + @Override + public String groupSplit() { + return null; + } }; test.pushRepository( initialRepo, From 4f9ce332288151ea80c0d445357d60916d93f4bc Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Wed, 22 Nov 2023 14:13:56 +0000 Subject: [PATCH 2/3] Make SSL verification configurable --- .../base/jvmbuildservice.io_jbsconfigs.yaml | 2 ++ deploy/overlays/dev-template/config.yaml | 1 + deploy/patch-yaml.sh | 4 ++++ .../analyser/deploy/DeployCommand.java | 5 +++- .../container/analyser/deploy/git/Git.java | 24 ++++++++++++++++--- .../container/analyser/deploy/git/GitHub.java | 3 ++- .../container/analyser/deploy/git/GitLab.java | 7 ++++-- .../analyser/deploy/git/GitTest.java | 4 ++-- .../crds/jvmbuildservice.io_jbsconfigs.yaml | 2 ++ .../v1alpha1/jbsconfig_types.go | 5 ++-- .../dependencybuild/buildrecipeyaml.go | 3 +++ 11 files changed, 49 insertions(+), 11 deletions(-) diff --git a/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml b/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml index dfadb6a02..428148434 100644 --- a/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml +++ b/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml @@ -89,6 +89,8 @@ spec: type: boolean gitSourceArchive: properties: + disableSSLVerification: + type: string identity: type: string url: diff --git a/deploy/overlays/dev-template/config.yaml b/deploy/overlays/dev-template/config.yaml index d1fd2237a..2804f7775 100644 --- a/deploy/overlays/dev-template/config.yaml +++ b/deploy/overlays/dev-template/config.yaml @@ -16,6 +16,7 @@ spec: gitSourceArchive: identity: GIT_DEPLOY_IDENTITY url: GIT_DEPLOY_URL + disableSSLVerification: GIT_DISABLE_SSL_VERIFICATION relocationPatterns: - relocationPattern: buildPolicy: "default" diff --git a/deploy/patch-yaml.sh b/deploy/patch-yaml.sh index ccb45e3eb..fc0c44887 100755 --- a/deploy/patch-yaml.sh +++ b/deploy/patch-yaml.sh @@ -53,5 +53,9 @@ fi if [ -z "${GIT_DEPLOY_IDENTITY}" ]; then GIT_DEPLOY_IDENTITY="" fi +if [ -z "${GIT_DISABLE_SSL_VERIFICATION}" ]; then + GIT_DISABLE_SSL_VERIFICATION="false" +fi find $DIR -path \*development\*.yaml -exec $SED -i s/GIT_DEPLOY_URL/${GIT_DEPLOY_URL}/ {} \; find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DEPLOY_IDENTITY%${GIT_DEPLOY_IDENTITY}% {} \; +find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DISABLE_SSL_VERIFICATION%${GIT_DISABLE_SSL_VERIFICATION}% {} \; diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java index 101802da5..7fd83b2a1 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java @@ -134,6 +134,9 @@ public class DeployCommand implements Runnable { @CommandLine.Option(names = "--git-identity") String gitIdentity; + @CommandLine.Option(names = "--git-disable-ssl-verification") + boolean gitDisableSSLVerification; + @CommandLine.Option(names = "--build-id") String buildId; // Testing only ; used to disable image deployment @@ -156,7 +159,7 @@ public void run() { // Save the source first regardless of deployment checks if (isNotEmpty(gitIdentity) && gitToken.isPresent()) { Log.infof("Git credentials are identity '%s' and URL '%s'", gitIdentity, gitURL); - var git = Git.builder(gitURL, gitIdentity, gitToken.get()); + var git = Git.builder(gitURL, gitIdentity, gitToken.get(), gitDisableSSLVerification); git.create(scmUri); git.add(sourcePath, commit, imageId); } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java index b926a127a..71bc59c4e 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java @@ -19,6 +19,8 @@ public abstract class Git { protected CredentialsProvider credentialsProvider; + protected boolean disableSSLVerification; + public abstract void create(String name) throws IOException, URISyntaxException; @@ -35,14 +37,28 @@ public abstract void add(Path path, String commit, String imageId) */ public static Git builder(String endpoint, String identity, String token) throws IOException { + return builder(endpoint, identity, token, true); + } + + /** + * + * @param endpoint URL of the GitHub or GitLab instance. + * @param identity Might be user or organisation name. + * @param token Authorisation token. + * @param disableSSLVerification Whether to enable SSLVerification (Default: true). + * @return Valid Git instance + * @throws IOException if an error occurs + */ + public static Git builder(String endpoint, String identity, String token, boolean disableSSLVerification) + throws IOException { // TODO: This could be a bit presumptuous to assume // an on-premise installation will always contain some determinable // information. Alternative would be forcing the user to configure // endpoint, token, AND type [gitlab|github] if (endpoint != null && endpoint.contains("gitlab")) { - return new GitLab(endpoint, identity, token); + return new GitLab(endpoint, identity, token, disableSSLVerification); } else { - return new GitHub(endpoint, identity, token); + return new GitHub(endpoint, identity, token, disableSSLVerification); } } @@ -61,7 +77,9 @@ protected void pushRepository(Path path, String httpTransportUrl, String commit, Log.infof("Updating current origin of %s to %s", jConfig.getString("remote", "origin", "url"), httpTransportUrl); jConfig.setString("remote", "origin", "url", httpTransportUrl); - jConfig.setBoolean("http", null, "sslVerify", false); + if (disableSSLVerification) { + jConfig.setBoolean("http", null, "sslVerify", false); + } jConfig.save(); Log.infof("Pushing to %s with content from %s (branch %s, commit %s, tag %s)", httpTransportUrl, path, jRepo.getBranch(), commit, tagName); diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java index ff8198085..240bf72fc 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java @@ -29,7 +29,7 @@ enum Type { private GHRepository repository; - public GitHub(String endpoint, String identity, String token) + public GitHub(String endpoint, String identity, String token, boolean ssl) throws IOException { if (isNotEmpty(token)) { github = new GitHubBuilder().withEndpoint(endpoint == null ? GITHUB_URL : endpoint) @@ -41,6 +41,7 @@ public GitHub(String endpoint, String identity, String token) } owner = identity; credentialsProvider = new UsernamePasswordCredentialsProvider(token, ""); + disableSSLVerification = ssl; switch (github.getUser(identity).getType()) { case "User" -> type = Type.USER; diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java index 58cf2216b..ba726eeb5 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java @@ -20,12 +20,15 @@ public class GitLab extends Git { private Project project; - public GitLab(String endpoint, String identity, String token) { + public GitLab(String endpoint, String identity, String token, boolean ssl) { gitLabApi = new GitLabApi(endpoint, token); owner = identity; credentialsProvider = new UsernamePasswordCredentialsProvider("", token); + disableSSLVerification = ssl; - gitLabApi.setIgnoreCertificateErrors(true); + if (disableSSLVerification) { + gitLabApi.setIgnoreCertificateErrors(true); + } } GitLab() { diff --git a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java index 56afb4cc7..31095c655 100644 --- a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java +++ b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java @@ -106,11 +106,11 @@ public String groupSplit() { @Test public void testIdentity() throws IOException { - new GitHub(null, "cekit", null); + new GitHub(null, "cekit", null, true); List logRecords = LogCollectingTestResource.current().getRecords(); assertTrue(logRecords.stream().anyMatch(r -> LogCollectingTestResource.format(r).matches("Type ORGANISATION"))); LogCollectingTestResource.current().clear(); - new GitHub(null, "rnc", null); + new GitHub(null, "rnc", null, true); logRecords = LogCollectingTestResource.current().getRecords(); assertTrue(logRecords.stream().anyMatch(r -> LogCollectingTestResource.format(r).matches("Type USER"))); } diff --git a/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml b/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml index dfadb6a02..428148434 100644 --- a/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml +++ b/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml @@ -89,6 +89,8 @@ spec: type: boolean gitSourceArchive: properties: + disableSSLVerification: + type: string identity: type: string url: diff --git a/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go b/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go index 2e44361ce..8889d495d 100644 --- a/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go +++ b/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go @@ -111,8 +111,9 @@ type MavenDeployment struct { } type GitSourceArchive struct { - Identity string `json:"identity,omitempty"` - URL string `json:"url,omitempty"` + Identity string `json:"identity,omitempty"` + URL string `json:"url,omitempty"` + DisableSSLVerification string `json:"disableSSLVerification,omitempty"` } type RelocationPatternElement struct { diff --git a/pkg/reconciler/dependencybuild/buildrecipeyaml.go b/pkg/reconciler/dependencybuild/buildrecipeyaml.go index 47f3eee82..de74f0367 100644 --- a/pkg/reconciler/dependencybuild/buildrecipeyaml.go +++ b/pkg/reconciler/dependencybuild/buildrecipeyaml.go @@ -666,6 +666,9 @@ func imageRegistryCommands(imageId string, recipe *v1alpha12.BuildRecipe, db *v1 if jbsConfig.Spec.GitSourceArchive.URL != "" { mavenArgs = append(mavenArgs, "--git-url="+jbsConfig.Spec.GitSourceArchive.URL) } + if jbsConfig.Spec.GitSourceArchive.DisableSSLVerification != "" { + mavenArgs = append(mavenArgs, "--git-disable-ssl-verification="+jbsConfig.Spec.GitSourceArchive.DisableSSLVerification) + } deployArgs = append(deployArgs, mavenArgs...) hermeticPreBuildImageArgs := []string{ From fa3250c79039dd8fbb363165999511a09b988357 Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Thu, 23 Nov 2023 14:44:15 +0000 Subject: [PATCH 3/3] Correct typing on SSL Verification --- deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml | 2 +- deploy/patch-yaml.sh | 2 +- .../main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml | 2 +- pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go | 2 +- pkg/reconciler/dependencybuild/buildrecipeyaml.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml b/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml index 428148434..edb422d83 100644 --- a/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml +++ b/deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml @@ -90,7 +90,7 @@ spec: gitSourceArchive: properties: disableSSLVerification: - type: string + type: boolean identity: type: string url: diff --git a/deploy/patch-yaml.sh b/deploy/patch-yaml.sh index fc0c44887..f1871631c 100755 --- a/deploy/patch-yaml.sh +++ b/deploy/patch-yaml.sh @@ -56,6 +56,6 @@ fi if [ -z "${GIT_DISABLE_SSL_VERIFICATION}" ]; then GIT_DISABLE_SSL_VERIFICATION="false" fi -find $DIR -path \*development\*.yaml -exec $SED -i s/GIT_DEPLOY_URL/${GIT_DEPLOY_URL}/ {} \; +find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DEPLOY_URL%${GIT_DEPLOY_URL}% {} \; find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DEPLOY_IDENTITY%${GIT_DEPLOY_IDENTITY}% {} \; find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DISABLE_SSL_VERIFICATION%${GIT_DISABLE_SSL_VERIFICATION}% {} \; diff --git a/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml b/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml index 428148434..edb422d83 100644 --- a/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml +++ b/java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml @@ -90,7 +90,7 @@ spec: gitSourceArchive: properties: disableSSLVerification: - type: string + type: boolean identity: type: string url: diff --git a/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go b/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go index 8889d495d..7fdb28631 100644 --- a/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go +++ b/pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go @@ -113,7 +113,7 @@ type MavenDeployment struct { type GitSourceArchive struct { Identity string `json:"identity,omitempty"` URL string `json:"url,omitempty"` - DisableSSLVerification string `json:"disableSSLVerification,omitempty"` + DisableSSLVerification bool `json:"disableSSLVerification,omitempty"` } type RelocationPatternElement struct { diff --git a/pkg/reconciler/dependencybuild/buildrecipeyaml.go b/pkg/reconciler/dependencybuild/buildrecipeyaml.go index de74f0367..5ec8ebe4d 100644 --- a/pkg/reconciler/dependencybuild/buildrecipeyaml.go +++ b/pkg/reconciler/dependencybuild/buildrecipeyaml.go @@ -666,8 +666,8 @@ func imageRegistryCommands(imageId string, recipe *v1alpha12.BuildRecipe, db *v1 if jbsConfig.Spec.GitSourceArchive.URL != "" { mavenArgs = append(mavenArgs, "--git-url="+jbsConfig.Spec.GitSourceArchive.URL) } - if jbsConfig.Spec.GitSourceArchive.DisableSSLVerification != "" { - mavenArgs = append(mavenArgs, "--git-disable-ssl-verification="+jbsConfig.Spec.GitSourceArchive.DisableSSLVerification) + if jbsConfig.Spec.GitSourceArchive.DisableSSLVerification { + mavenArgs = append(mavenArgs, "--git-disable-ssl-verification") } deployArgs = append(deployArgs, mavenArgs...)