refactor fabric8 catalog watch integration test using PATCH (#1450)

This commit is contained in:
erabii
2023-10-02 21:04:34 +03:00
committed by GitHub
parent 9b01949188
commit 65c7644f66
8 changed files with 378 additions and 339 deletions

View File

@@ -158,7 +158,15 @@ public final class Commons {
Files.copy(imageStream, imagePath);
// import image with ctr. this works because TEMP_FOLDER is mounted in the
// container
container.execInContainer("ctr", "i", "import", TEMP_FOLDER + "/" + tarName + ".tar");
await().atMost(Duration.ofMinutes(2)).pollInterval(Duration.ofSeconds(1)).until(() -> {
Container.ExecResult result = container.execInContainer("ctr", "i", "import",
TEMP_FOLDER + "/" + tarName + ".tar");
boolean noErrors = result.getStderr() == null || result.getStderr().isEmpty();
if (!noErrors) {
LOG.info("error is : " + result.getStderr());
}
return noErrors;
});
}
}

View File

@@ -414,7 +414,8 @@ public final class Util {
fail("No deployment with name " + deploymentName);
}
Deployment deployment = deployments.getItems().get(0);
Deployment deployment = deployments.getItems().stream()
.filter(x -> x.getMetadata().getName().equals(deploymentName)).findFirst().orElseThrow();
// if no replicas are defined, it means only 1 is needed
int replicas = Optional.ofNullable(deployment.getSpec().getReplicas()).orElse(1);