Skip to content

Commit

Permalink
Merge pull request #1389 from jeyrschabu/submit_job_with_label
Browse files Browse the repository at this point in the history
(titus)  Setting interestingHealthProvider (if present) as a titus job label
  • Loading branch information
jeyrschabu authored Jan 24, 2017
2 parents f0d48dc + adae8ed commit dfd14d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class TitusDeployDescription extends AbstractTitusCredentialsDescription impleme
int retries
int runtimeLimitSecs
Boolean useApplicationDefaultSecurityGroup = true
String interestingHealthProviderNames

@Canonical
static class Capacity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class TitusDeployHandler implements DeployHandler<TitusDeployDescription> {
if (!description.env) description.env = [:]
if (!description.labels) description.labels = [:]

if (description.interestingHealthProviderNames) {
description.labels.put("interestingHealthProviderNames", description.interestingHealthProviderNames )
}

SubmitJobRequest submitJobRequest = new SubmitJobRequest()
.withJobName(nextServerGroupName)
.withApplication(description.application)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class TitusDeployHandlerSpec extends Specification {
capacity: [desired: 1, min: 1, max: 2],
resources: [cpu: 2, memory: 4, disk: 4000, ports: [7001], allocateIpAddress: true],
env: ['netflix.environment': 'test'],
credentials: testCredentials
credentials: testCredentials,
interestingHealthProviderNames: "Titus"
)
titusClient.findJobsByApplication(_) >> []

Expand Down Expand Up @@ -90,7 +91,8 @@ class TitusDeployHandlerSpec extends Specification {
it.ports == titusDeployDescription.resources.ports &&
it.env == titusDeployDescription.env &&
it.application == titusDeployDescription.application &&
it.allocateIpAddress == titusDeployDescription.resources.allocateIpAddress
it.allocateIpAddress == titusDeployDescription.resources.allocateIpAddress &&
it.labels.get("interestingHealthProviderNames") == titusDeployDescription.interestingHealthProviderNames
} as SubmitJobRequest)
}

Expand Down

0 comments on commit dfd14d6

Please sign in to comment.