Skip to content

Commit 86223a7

Browse files
committed
fix: default provider URL shouldn't fail
Signed-off-by: Chris Laprun <[email protected]>
1 parent 66ca09a commit 86223a7

File tree

1 file changed

+14
-10
lines changed
  • bundle-generator/deployment/src/main/java/io/quarkiverse/operatorsdk/bundle/deployment

1 file changed

+14
-10
lines changed

bundle-generator/deployment/src/main/java/io/quarkiverse/operatorsdk/bundle/deployment/BundleProcessor.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,22 @@ private static String getDefaultProviderURLFromSCMInfo(ApplicationInfoBuildItem
140140
if (scmInfo != null) {
141141
var origin = scmInfo.getRemote().get("origin");
142142
if (origin != null) {
143-
int atSign = origin.indexOf('@');
144-
if (atSign > 0) {
145-
origin = origin.substring(atSign + 1);
146-
origin = origin.replaceFirst(":", "/");
147-
origin = "https://" + origin;
148-
}
143+
try {
144+
int atSign = origin.indexOf('@');
145+
if (atSign > 0) {
146+
origin = origin.substring(atSign + 1);
147+
origin = origin.replaceFirst(":", "/");
148+
origin = "https://" + origin;
149+
}
149150

150-
int dotGit = origin.indexOf(".git");
151-
if (dotGit < origin.length() - 1) {
152-
origin = origin.substring(0, dotGit);
151+
int dotGit = origin.indexOf(".git");
152+
if (dotGit < origin.length() - 1) {
153+
origin = origin.substring(0, dotGit);
154+
}
155+
return origin;
156+
} catch (Exception e) {
157+
log.warnv("Couldn't parse SCM information: {0}", origin);
153158
}
154-
return origin;
155159
}
156160
}
157161
return null;

0 commit comments

Comments
 (0)