Skip to content

Commit 088f5d4

Browse files
authored
updated monexp to 2.0 (#2401)
* update monexp to 2.0
1 parent 90b48ba commit 088f5d4

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
import static oracle.weblogic.kubernetes.TestConstants.GRAFANA_CHART_VERSION;
111111
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
112112
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
113-
import static oracle.weblogic.kubernetes.TestConstants.MONITORING_EXPORTER_VERSION;
114113
import static oracle.weblogic.kubernetes.TestConstants.OCIR_EMAIL;
115114
import static oracle.weblogic.kubernetes.TestConstants.OCIR_PASSWORD;
116115
import static oracle.weblogic.kubernetes.TestConstants.OCIR_REGISTRY;
@@ -1397,12 +1396,9 @@ private static void installMonitoringExporter() {
13971396

13981397
monitoringExporterSrcDir = monitoringTemp.toString();
13991398
monitoringExporterEndToEndDir = monitoringTemp + "/samples/kubernetes/end2end/";
1400-
String monitoringExporterVersion = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_VERSION"))
1401-
.orElse(MONITORING_EXPORTER_VERSION);
14021399

14031400
//adding ability to build monitoring exporter if branch is not master
14041401
boolean toBuildMonitoringExporter = (!monitoringExporterBranch.equalsIgnoreCase(("master")));
1405-
logger.info("create a monitoring exporter version {0} ",monitoringExporterVersion);
14061402
monitoringExporterAppDir = monitoringApp.toString();
14071403
String monitoringExporterAppNoRestPortDir = monitoringAppNoRestPort.toString();
14081404

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ public interface TestConstants {
235235
public static final String WDT_BASIC_APP_NAME = "sample-app";
236236

237237
//monitoring constants
238-
public static final String MONITORING_EXPORTER_VERSION = Optional.ofNullable(System.getenv(
239-
"MONITORING_EXPORTER_VERSION"))
240-
.orElse("1.3.0");
238+
public static final String MONITORING_EXPORTER_WEBAPP_VERSION = Optional.ofNullable(System.getenv(
239+
"MONITORING_EXPORTER_WEBAPP_VERSION"))
240+
.orElse("2.0");
241241
public static final String MONITORING_EXPORTER_BRANCH = Optional.ofNullable(System.getenv(
242242
"MONITORING_EXPORTER_BRANCH"))
243243
.orElse("master");

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import static java.util.concurrent.TimeUnit.MINUTES;
1919
import static java.util.concurrent.TimeUnit.SECONDS;
2020
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
21-
import static oracle.weblogic.kubernetes.TestConstants.MONITORING_EXPORTER_VERSION;
21+
import static oracle.weblogic.kubernetes.TestConstants.MONITORING_EXPORTER_WEBAPP_VERSION;
2222
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
2323
import static oracle.weblogic.kubernetes.utils.FileUtils.checkDirectory;
2424
import static oracle.weblogic.kubernetes.utils.FileUtils.checkFile;
@@ -39,17 +39,21 @@ public class MonitoringUtils {
3939
*/
4040
public static void downloadMonitoringExporterApp(String configFile, String applicationDir) {
4141
LoggingFacade logger = getLogger();
42-
String monitoringExporterVersion = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_VERSION"))
43-
.orElse(MONITORING_EXPORTER_VERSION);
42+
//version of wls-exporter.war published in https://github.com/oracle/weblogic-monitoring-exporter/releases/
43+
String monitoringExporterWebAppVersion = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_WEBAPP_VERSION"))
44+
.orElse(MONITORING_EXPORTER_WEBAPP_VERSION);
45+
4446
String monitoringExporterBuildFile = String.format(
45-
"%s/get%s.sh", applicationDir, monitoringExporterVersion);
47+
"%s/get%s.sh", applicationDir, monitoringExporterWebAppVersion);
4648
checkDirectory(applicationDir);
4749
logger.info("Download a monitoring exporter build file {0} ", monitoringExporterBuildFile);
50+
String monitoringExporterRelease =
51+
monitoringExporterWebAppVersion.equals("2.0") ? "2.0.0" : monitoringExporterWebAppVersion;
4852
String curlDownloadCmd = String.format("cd %s && "
4953
+ "curl -O -L -k https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v%s/get%s.sh",
5054
applicationDir,
51-
monitoringExporterVersion,
52-
monitoringExporterVersion);
55+
monitoringExporterRelease,
56+
monitoringExporterWebAppVersion);
5357
logger.info("execute command a monitoring exporter curl command {0} ", curlDownloadCmd);
5458
assertTrue(new Command()
5559
.withParams(new CommandParams()

0 commit comments

Comments
 (0)