Skip to content

Commit d0d6bd2

Browse files
committed
remove unused comments, add improve OpenshiftBuildServiceIntegrationTest tests
Signed-off-by: Oleksandr Krutko <[email protected]>
1 parent b69b79f commit d0d6bd2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/openshift/OpenshiftBuildService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ private void waitForOpenShiftBuildToComplete(OpenShiftClient client, Build build
466466
// Don't query for logs directly, Watch over the build pod:
467467
waitUntilPodIsReady(buildName + "-build", 120, log);
468468
log.info("Waiting for build " + buildName + " to complete...");
469-
//try (LogWatch logWatch = client.pods().inNamespace(applicableOpenShiftNamespace).withName(buildName + "-build").watchLog()) {
470469
try (LogWatch logWatch = client.builds().inNamespace(applicableOpenShiftNamespace).withName(buildName).watchLog()) {
471470
KubernetesHelper.printLogsAsync(logWatch, line -> log.info("[[s]]%s", line))
472471
.whenComplete((v, t) -> {

jkube-kit/config/service/src/test/java/org/eclipse/jkube/kit/config/service/openshift/OpenshiftBuildServiceIntegrationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ private WebServerEventCollector prepareMockServer(
562562
.build();
563563

564564
if (!buildConfigExists) {
565+
mockServer.expect().get().withPath("/api/v1/namespaces/ns1/pods?labelSelector=openshift.io%2Fbuild.name").andReply(collector.record("build-config-check").andReturn(200, bc)).always();
565566
mockServer.expect().get().withPath("/apis/build.openshift.io/v1/namespaces/ns1/buildconfigs/" + resourceName + s2iBuildNameSuffix).andReply(collector.record("build-config-check").andReturn
566567
(404, "")).once();
567568
mockServer.expect().get().withPath("/apis/build.openshift.io/v1/namespaces/ns1/buildconfigs/" + resourceName + s2iBuildNameSuffix + "pullSecret").andReply(collector.record("build-config-check").andReturn
@@ -570,7 +571,7 @@ private WebServerEventCollector prepareMockServer(
570571
if (bcSecret != null) {
571572
mockServer.expect().post().withPath("/apis/build.openshift.io/v1/namespaces/ns1/buildconfigs").andReply(collector.record("new-build-config").andReturn(201, bcSecret)).once();
572573
}
573-
} else {
574+
} else {
574575
mockServer.expect().patch().withPath("/apis/build.openshift.io/v1/namespaces/ns1/buildconfigs/" + resourceName + s2iBuildNameSuffix).andReply(collector.record("patch-build-config").andReturn
575576
(200, bc)).once();
576577
if (bcSecret != null) {
@@ -589,6 +590,7 @@ private WebServerEventCollector prepareMockServer(
589590
if (!imageStreamExists) {
590591
mockServer.expect().get().withPath("/apis/image.openshift.io/v1/namespaces/ns1/imagestreams/" + resourceName).andReturn(404, "").once();
591592
}
593+
mockServer.expect().get().withPath("/api/v1/namespaces/ns1/pods?labelSelector=openshift.io%2Fbuild.name").andReply(collector.record("build-config-check").andReturn(200, bc)).always();
592594
mockServer.expect().get().withPath("/apis/image.openshift.io/v1/namespaces/ns1/imagestreams/" + resourceName).andReturn(200, imageStream).always();
593595

594596
mockServer.expect().post().withPath("/apis/image.openshift.io/v1/namespaces/ns1/imagestreams").andReturn(201, imageStream).once();

0 commit comments

Comments
 (0)