From 2f0c9e927601aadfdcf23f01410f93e591a8dcf1 Mon Sep 17 00:00:00 2001 From: Oleksii Moskalenko Date: Tue, 1 Sep 2020 10:14:03 +0800 Subject: [PATCH] fetch job labels from dataflow --- .../jobcontroller/runner/dataflow/DataflowJobManager.java | 4 ++++ .../jobcontroller/runner/dataflow/DataflowJobManagerTest.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/job-controller/src/main/java/feast/jobcontroller/runner/dataflow/DataflowJobManager.java b/job-controller/src/main/java/feast/jobcontroller/runner/dataflow/DataflowJobManager.java index 4ceb8f50b8..38be7522fd 100644 --- a/job-controller/src/main/java/feast/jobcontroller/runner/dataflow/DataflowJobManager.java +++ b/job-controller/src/main/java/feast/jobcontroller/runner/dataflow/DataflowJobManager.java @@ -304,6 +304,10 @@ public List listRunningJobs() { .setStores( stores.stream() .collect(Collectors.toMap(StoreProto.Store::getName, s -> s))) + .setLabels( + dfJob.getLabels() == null + ? new HashMap<>() + : new HashMap<>(dfJob.getLabels())) .build(); job.setExtId(dfJob.getId()); diff --git a/job-controller/src/test/java/feast/jobcontroller/runner/dataflow/DataflowJobManagerTest.java b/job-controller/src/test/java/feast/jobcontroller/runner/dataflow/DataflowJobManagerTest.java index 5ac80788a5..7cf922febb 100644 --- a/job-controller/src/test/java/feast/jobcontroller/runner/dataflow/DataflowJobManagerTest.java +++ b/job-controller/src/test/java/feast/jobcontroller/runner/dataflow/DataflowJobManagerTest.java @@ -275,7 +275,8 @@ public void shouldRetrieveRunningJobsFromDataflow() { hasProperty("stores", hasValue(store)), hasProperty("extId", equalTo("job-2")), hasProperty("created", equalTo(created.toDate())), - hasProperty("lastUpdated", equalTo(created.toDate()))))); + hasProperty("lastUpdated", equalTo(created.toDate())), + hasProperty("labels", hasEntry("application", "feast"))))); } @Test