|
66 | 66 | import static oracle.weblogic.kubernetes.actions.TestActions.scaleClusterWithRestApi;
|
67 | 67 | import static oracle.weblogic.kubernetes.actions.TestActions.scaleClusterWithWLDF;
|
68 | 68 | import static oracle.weblogic.kubernetes.actions.impl.UniqueName.random;
|
69 |
| -import static oracle.weblogic.kubernetes.actions.impl.primitive.Command.defaultCommandParams; |
70 | 69 | import static oracle.weblogic.kubernetes.assertions.TestAssertions.credentialsNotValid;
|
71 | 70 | import static oracle.weblogic.kubernetes.assertions.TestAssertions.credentialsValid;
|
72 | 71 | import static oracle.weblogic.kubernetes.assertions.TestAssertions.podStateNotChanged;
|
@@ -1279,67 +1278,7 @@ public static String getActualLocationIfNeeded(
|
1279 | 1278 | ) throws RuntimeException {
|
1280 | 1279 | String actualLocation = location;
|
1281 | 1280 | if (needToGetActualLocation(location, type)) {
|
1282 |
| - String version = ""; |
1283 |
| - String command = String.format( |
1284 |
| - "curl -fL %s -o %s/%s-%s", |
1285 |
| - location, |
1286 |
| - downloadDir, |
1287 |
| - type, |
1288 |
| - TMP_FILE_NAME); |
1289 |
| - |
1290 |
| - CommandParams params = |
1291 |
| - defaultCommandParams() |
1292 |
| - .command(command) |
1293 |
| - .saveResults(true); |
1294 |
| - if (!Command.withParams(params).execute()) { |
1295 |
| - RuntimeException exception = |
1296 |
| - new RuntimeException(String.format("Failed to get the latest %s release information.", type)); |
1297 |
| - getLogger().severe( |
1298 |
| - String.format( |
1299 |
| - "Failed to get the latest %s release information. The stderr is %s", |
1300 |
| - type, |
1301 |
| - params.stderr()), |
1302 |
| - exception); |
1303 |
| - throw exception; |
1304 |
| - } |
1305 |
| - |
1306 |
| - command = String.format( |
1307 |
| - "cat %s/%s-%s | grep 'releases/download' | awk '{ split($0,a,/href=\"/);%s | %s", |
1308 |
| - downloadDir, |
1309 |
| - type, |
1310 |
| - TMP_FILE_NAME, |
1311 |
| - " print a[2] }'", |
1312 |
| - " cut -d/ -f 6"); |
1313 |
| - |
1314 |
| - params = |
1315 |
| - defaultCommandParams() |
1316 |
| - .command(command) |
1317 |
| - .saveResults(true) |
1318 |
| - .redirect(true); |
1319 |
| - |
1320 |
| - // the command is considered successful only if we have got back a real version number in params.stdout() |
1321 |
| - if (Command.withParams(params).execute() |
1322 |
| - && params.stdout() != null |
1323 |
| - && params.stdout().length() != 0) { |
1324 |
| - // Because I've updated the name of the logging exporter to remove the version number in the name, but |
1325 |
| - // also preserved the original, there will be two entries located. Take the first. |
1326 |
| - version = params.stdout().lines().findFirst().get().trim(); |
1327 |
| - } else { |
1328 |
| - RuntimeException exception = |
1329 |
| - new RuntimeException(String.format("Failed to get the version number of the requested %s release.", type)); |
1330 |
| - getLogger().severe( |
1331 |
| - String.format( |
1332 |
| - "Failed to get the version number of the requested %s release. The stderr is %s", |
1333 |
| - type, |
1334 |
| - params.stderr()), |
1335 |
| - exception); |
1336 |
| - throw exception; |
1337 |
| - } |
1338 |
| - |
1339 |
| - if (version != null) { |
1340 |
| - actualLocation = location.replace("latest", |
1341 |
| - String.format("download/%s/%s", version, getInstallerFileName(type))); |
1342 |
| - } |
| 1281 | + actualLocation = location + "/download/" + getInstallerFileName(type); |
1343 | 1282 | }
|
1344 | 1283 | getLogger().info("The actual download location for {0} is {1}", type, actualLocation);
|
1345 | 1284 | return actualLocation;
|
|
0 commit comments