Skip to content

Commit

Permalink
No longer require manifest param on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
drich10 committed Dec 13, 2017
1 parent 5c31dc0 commit f8ca6dd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ deployment manifest and then deploy.
# Delete
- put: staging
params:
manifest: path/to/manifest.yml
delete:
enabled: true
force: true
Expand Down
2 changes: 1 addition & 1 deletion concourse/out_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewOutRequest(request []byte, sourcesDir string) (OutRequest, error) {
func checkRequiredOutParameters(params OutParams) error {
missingParameters := []string{}

if params.Manifest == "" {
if params.Manifest == "" && !params.Delete.Enabled {
missingParameters = append(missingParameters, "manifest")
}

Expand Down
21 changes: 21 additions & 0 deletions concourse/out_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,27 @@ var _ = Describe("NewOutRequest", func() {
})
})

Context("when delete is specified", func() {
It("does not require the manifest parameter", func() {
config := []byte(`{
"source": {
"deployment": "mydeployment",
"target": "director.example.com",
"client": "foo",
"client_secret": "foobar"
},
"params": {
"delete": {
"enabled": true
}
}
}`)

_, err := concourse.NewOutRequest(config, "")
Expect(err).NotTo(HaveOccurred())
})
})

Context("when a required parameter is missing", func() {
It("returns an error with each missing parameter", func() {
config := []byte(`{
Expand Down

0 comments on commit f8ca6dd

Please sign in to comment.