Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static List<PodResource> getFilteredPodsForLogs(PodOperationsImpl podOper
public static PodOperationsImpl getGenericPodOperations(OperationContext context, PodOperationContext podOperationContext) {
return new PodOperationsImpl(
podOperationContext,
context.withName(null).withApiGroupName(null).withApiGroupVersion("v1"));
context.withName(null).withItem(null).withApiGroupName(null).withApiGroupVersion("v1"));
}

public static List<PodResource> getPodOperationsForController(OperationContext context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class JobIT {
void testGetLog() {
final String jobName = "job-get-log";
client.batch().v1().jobs().createOrReplace(initJob("job-get-log").build());
client.batch().v1().jobs().withName(jobName).waitUntilCondition(
Job job = client.batch().v1().jobs().withName(jobName).waitUntilCondition(
j -> Optional.ofNullable(j).map(Job::getStatus).map(JobStatus::getSucceeded).orElse(0) > 0,
1, TimeUnit.MINUTES);
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
Expand All @@ -52,6 +52,15 @@ void testGetLog() {
assertNotNull(baos.toString());
assertEquals("This is a message!\n", baos.toString());
}
ByteArrayOutputStream baos2 = new ByteArrayOutputStream(1024);
try (LogWatch ignore = client.batch().v1().jobs()
.resource(job)
.withLogWaitTimeout(30)
.watchLog(baos2)) {
await().atMost(30, TimeUnit.SECONDS).until(() -> baos2.toString().length() > 0);
assertNotNull(baos2.toString());
assertEquals("This is a message!\n", baos2.toString());
}
}

@Test
Expand Down