use of io.strimzi.test.executor.ExecResult in project strimzi by strimzi.
the class AbstractUpgradeST method convertCRDs.
protected void convertCRDs(JsonObject conversionTool, String namespace) throws IOException {
String url = conversionTool.getString("urlToConversionTool");
File dir = FileUtils.downloadAndUnzip(url);
String convertorPath = dir.getAbsolutePath() + "/" + conversionTool.getString("toConversionTool") + "/bin/api-conversion.sh";
Exec.exec("chmod", "+x", convertorPath);
LOGGER.info("Converting CRs ...");
// CRS conversion needs old versions of Strimzi CRDs, which are not available after 0.22
if (cmdKubeClient().exec(true, Level.DEBUG, "get", "crd", "kafkas.kafka.strimzi.io", "-o", "jsonpath={.spec.versions}").out().trim().contains(Constants.V1ALPHA1)) {
ExecResult execResult = Exec.exec(convertorPath, "cr", "-n=" + namespace);
LOGGER.debug("CRs conversion STDOUT:");
LOGGER.debug(execResult.out());
LOGGER.debug("CRs conversion STDERR:");
LOGGER.debug(execResult.err());
LOGGER.info("CRs conversion done!");
// run crd-upgrade
LOGGER.info("Converting CRDs");
execResult = Exec.exec(convertorPath, "crd");
LOGGER.debug("CRDs conversion STDOUT:");
LOGGER.debug(execResult.out());
LOGGER.debug("CRDs conversion STDERR:");
LOGGER.debug(execResult.err());
LOGGER.info("CRDs conversion done!");
waitForKafkaCRDChange();
} else {
LOGGER.info("CRs and CRDs already have v1beta2 versions");
}
}
use of io.strimzi.test.executor.ExecResult in project strimzi-kafka-operator by strimzi.
the class KeycloakUtils method deployKeycloak.
public static void deployKeycloak(String namespace) {
LOGGER.info("Prepare Keycloak in namespace: {}", namespace);
// This is needed because from time to time the first try fails on Azure
TestUtils.waitFor("Keycloak instance readiness", Constants.KEYCLOAK_DEPLOYMENT_POLL, Constants.KEYCLOAK_DEPLOYMENT_TIMEOUT, () -> {
ExecResult result = Exec.exec(Level.INFO, "/bin/bash", PATH_TO_KEYCLOAK_PREPARE_SCRIPT, namespace, getValidKeycloakVersion());
if (!result.out().contains("All realms were successfully imported")) {
LOGGER.info("Errors occurred during Keycloak install: {}", result.err());
return false;
}
return true;
});
LOGGER.info("Keycloak in namespace {} is ready", namespace);
}
use of io.strimzi.test.executor.ExecResult in project strimzi-kafka-operator by strimzi.
the class AbstractUpgradeST method convertCRDs.
protected void convertCRDs(JsonObject conversionTool, String namespace) throws IOException {
String url = conversionTool.getString("urlToConversionTool");
File dir = FileUtils.downloadAndUnzip(url);
String convertorPath = dir.getAbsolutePath() + "/" + conversionTool.getString("toConversionTool") + "/bin/api-conversion.sh";
Exec.exec("chmod", "+x", convertorPath);
LOGGER.info("Converting CRs ...");
// CRS conversion needs old versions of Strimzi CRDs, which are not available after 0.22
if (cmdKubeClient().exec(true, Level.DEBUG, "get", "crd", "kafkas.kafka.strimzi.io", "-o", "jsonpath={.spec.versions}").out().trim().contains(Constants.V1ALPHA1)) {
ExecResult execResult = Exec.exec(convertorPath, "cr", "-n=" + namespace);
LOGGER.debug("CRs conversion STDOUT:");
LOGGER.debug(execResult.out());
LOGGER.debug("CRs conversion STDERR:");
LOGGER.debug(execResult.err());
LOGGER.info("CRs conversion done!");
// run crd-upgrade
LOGGER.info("Converting CRDs");
execResult = Exec.exec(convertorPath, "crd");
LOGGER.debug("CRDs conversion STDOUT:");
LOGGER.debug(execResult.out());
LOGGER.debug("CRDs conversion STDERR:");
LOGGER.debug(execResult.err());
LOGGER.info("CRDs conversion done!");
waitForKafkaCRDChange();
} else {
LOGGER.info("CRs and CRDs already have v1beta2 versions");
}
}
Aggregations