Skip to content

Commit b3a182f

Browse files
fix tools download url (#3428)
1 parent 88e6c1a commit b3a182f

File tree

1 file changed

+1
-62
lines changed

1 file changed

+1
-62
lines changed

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

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
import static oracle.weblogic.kubernetes.actions.TestActions.scaleClusterWithRestApi;
6767
import static oracle.weblogic.kubernetes.actions.TestActions.scaleClusterWithWLDF;
6868
import static oracle.weblogic.kubernetes.actions.impl.UniqueName.random;
69-
import static oracle.weblogic.kubernetes.actions.impl.primitive.Command.defaultCommandParams;
7069
import static oracle.weblogic.kubernetes.assertions.TestAssertions.credentialsNotValid;
7170
import static oracle.weblogic.kubernetes.assertions.TestAssertions.credentialsValid;
7271
import static oracle.weblogic.kubernetes.assertions.TestAssertions.podStateNotChanged;
@@ -1279,67 +1278,7 @@ public static String getActualLocationIfNeeded(
12791278
) throws RuntimeException {
12801279
String actualLocation = location;
12811280
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);
13431282
}
13441283
getLogger().info("The actual download location for {0} is {1}", type, actualLocation);
13451284
return actualLocation;

0 commit comments

Comments
 (0)