refactor fabric8 catalog watch integration test using PATCH (#1450)
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user