Skip to content

Commit eb041ac

Browse files
authored
Backported version support and updated monexporter web app version to 2.0.7 for release 3.4 (#3413)
* Backported version support and updated monexporter web app version to 2.0.7 for release 3.4
1 parent 0a10e2b commit eb041ac

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/TestConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public interface TestConstants {
262262

263263
//monitoring constants
264264
public static final String MONITORING_EXPORTER_WEBAPP_VERSION =
265-
getNonEmptySystemProperty("wko.it.monitoring.exporter.webapp.version", "2.0");
265+
getNonEmptySystemProperty("wko.it.monitoring.exporter.webapp.version", "2.0.7");
266266
public static final String MONITORING_EXPORTER_BRANCH =
267267
getNonEmptySystemProperty("wko.it.monitoring.exporter.branch", "main");
268268
public static final String PROMETHEUS_CHART_VERSION =

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/MonitoringUtils.java

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
7979
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
8080
import static oracle.weblogic.kubernetes.utils.DomainUtils.createDomainAndVerify;
81-
import static oracle.weblogic.kubernetes.utils.FileUtils.checkDirectory;
8281
import static oracle.weblogic.kubernetes.utils.FileUtils.checkFile;
8382
import static oracle.weblogic.kubernetes.utils.FileUtils.replaceStringInFile;
8483
import static oracle.weblogic.kubernetes.utils.ImageUtils.createMiiImageAndVerify;
@@ -111,48 +110,44 @@ public class MonitoringUtils {
111110
*/
112111
public static void downloadMonitoringExporterApp(String configFile, String applicationDir) {
113112
//version of wls-exporter.war published in https://github.com/oracle/weblogic-monitoring-exporter/releases/
114-
String monitoringExporterWebAppVersion = MONITORING_EXPORTER_WEBAPP_VERSION;
115-
116-
String monitoringExporterBuildFile = String.format(
117-
"%s/get%s.sh", applicationDir, monitoringExporterWebAppVersion);
118-
checkDirectory(applicationDir);
119-
logger.info("Download a monitoring exporter build file {0} ", monitoringExporterBuildFile);
120-
String monitoringExporterRelease =
121-
monitoringExporterWebAppVersion.equals("2.0") ? "2.0.0" : monitoringExporterWebAppVersion;
113+
String monitoringExporterRelease = MONITORING_EXPORTER_WEBAPP_VERSION;
114+
String monitoringExporterWebAppScriptVersion = monitoringExporterRelease.substring(0,
115+
monitoringExporterRelease.length() - 2);
122116
String curlDownloadCmd = String.format("cd %s && "
123-
+ "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh",
124-
applicationDir,
125-
monitoringExporterRelease,
126-
monitoringExporterWebAppVersion);
117+
+ "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh",
118+
applicationDir,
119+
monitoringExporterRelease,
120+
monitoringExporterWebAppScriptVersion);
121+
String monitoringExporterBuildFile = String.format(
122+
"%s/get%s.sh", applicationDir, monitoringExporterWebAppScriptVersion);
127123
logger.info("execute command a monitoring exporter curl command {0} ", curlDownloadCmd);
128124
assertTrue(Command
129-
.withParams(new CommandParams()
130-
.command(curlDownloadCmd))
131-
.execute(), "Failed to download monitoring exporter webapp");
125+
.withParams(new CommandParams()
126+
.command(curlDownloadCmd))
127+
.execute(), "Failed to download monitoring exporter webapp");
132128
String command = String.format("chmod 777 %s ", monitoringExporterBuildFile);
133129
assertTrue(Command
134-
.withParams(new CommandParams()
135-
.command(command))
136-
.execute(), "Failed to download monitoring exporter webapp");
130+
.withParams(new CommandParams()
131+
.command(command))
132+
.execute(), "Failed to download monitoring exporter webapp");
137133

138134
String command1 = String.format("cd %s && %s %s",
139-
applicationDir,
140-
monitoringExporterBuildFile,
141-
configFile);
142-
135+
applicationDir,
136+
monitoringExporterBuildFile,
137+
configFile);
143138
testUntil(
144-
(() -> Command
145-
.withParams(
146-
new CommandParams()
147-
.verbose(true)
148-
.command(command1))
149-
.executeAndVerify("adding: config.yml")
150-
),
151-
logger,
152-
"Downloading monitoring exporter webapp");
139+
(() -> Command
140+
.withParams(
141+
new CommandParams()
142+
.verbose(true)
143+
.command(command1))
144+
.executeAndVerify("adding: config.yml")
145+
),
146+
logger,
147+
"Downloading monitoring exporter webapp");
153148

154149
assertDoesNotThrow(() -> checkFile(applicationDir + "/wls-exporter.war"),
155-
"Monitoring Exporter web application file was not found");
150+
"Monitoring Exporter web application file was not found");
156151
}
157152

158153
/**

0 commit comments

Comments
 (0)