Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Add Isolation Segment to docker staging request
Browse files Browse the repository at this point in the history
Signed-off-by: Sandy Cash <scarlet.tanager@gmail.com>
  • Loading branch information
Dan Lavine authored and ScarletTanager committed Dec 5, 2016
1 parent 7c2e928 commit 70e7589
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/docker_backend.go
Expand Up @@ -164,6 +164,10 @@ func (backend *dockerBackend) BuildRecipe(stagingGuid string, request cc_message
}
logger.Debug("staging-task-request")

if request.IsolationSegment != "" {
taskDefinition.PlacementTags = []string{request.IsolationSegment}
}

return taskDefinition, stagingGuid, backend.config.TaskDomain, nil
}

Expand Down
20 changes: 20 additions & 0 deletions backend/docker_backend_test.go
Expand Up @@ -273,6 +273,26 @@ var _ = Describe("DockerBackend", func() {
Expect(taskDef.TrustedSystemCertificatesPath).To(Equal(backend.TrustedSystemCertificatesPath))
})

It("does not set any Isolation Segments", func() {
taskDef, _, _, err := docker.BuildRecipe("staging-guid", stagingRequest)
Expect(err).NotTo(HaveOccurred())

Expect(taskDef.PlacementTags).To(BeEmpty())
})

Context("When the request has an Isolation Segment", func() {
JustBeforeEach(func() {
stagingRequest.IsolationSegment = "foo"
})

It("sets the Isolation Segment on the task definition", func() {
taskDef, _, _, err := docker.BuildRecipe("staging-guid", stagingRequest)
Expect(err).NotTo(HaveOccurred())

Expect(taskDef.PlacementTags).To(ContainElement("foo"))
})
})

Context("with a missing app id", func() {
BeforeEach(func() {
appID = ""
Expand Down

0 comments on commit 70e7589

Please sign in to comment.