Skip to content

Commit

Permalink
Titus v3: fix find job by name and set instance count to desired
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslin committed Mar 26, 2018
1 parent 857fce1 commit be3fa83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public Job(com.netflix.titus.grpc.protogen.Job grpcJob, List<com.netflix.titus.g
instancesMin = batchJobSpec.getSize();
instancesMax = batchJobSpec.getSize();
instancesDesired = batchJobSpec.getSize();
instances = batchJobSpec.getSize();
runtimeLimitSecs = (int)batchJobSpec.getRuntimeLimitSec();
retries = batchJobSpec.getRetryPolicy().getImmediate().getRetries();
}
Expand All @@ -250,6 +251,7 @@ public Job(com.netflix.titus.grpc.protogen.Job grpcJob, List<com.netflix.titus.g
type = "service";
ServiceJobSpec serviceSpec = grpcJob.getJobDescriptor().getService();
inService = serviceSpec.getEnabled();
instances = serviceSpec.getCapacity().getDesired();
instancesMin = serviceSpec.getCapacity().getMin();
instancesMax = serviceSpec.getCapacity().getMax();
instancesDesired = serviceSpec.getCapacity().getDesired();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public Job getJob(String jobId) {
public Job findJobByName(String jobName) {
JobQuery.Builder jobQuery = JobQuery.newBuilder()
.putFilteringCriteria("jobType", "SERVICE")
.putFilteringCriteria("labels", "source:spinnaker,name:" + jobName)
.putFilteringCriteria("labels.op", "and");
.putFilteringCriteria("attributes", "source:spinnaker,name:" + jobName)
.putFilteringCriteria("attributes.op", "and");
return getJobs(jobQuery).get(0);
}

Expand Down

0 comments on commit be3fa83

Please sign in to comment.