Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit 90ee7a3

Browse files
Anthony Emengojoaopapereira
authored andcommitted
Stop deploying services by default
[#162967938] Signed-off-by: Joao Pereira <[email protected]>
1 parent ed2fdcb commit 90ee7a3

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

cmd/start/start_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ var _ = Describe("Start", func() {
5454
{
5555
Name: "some-service",
5656
Flagname: "some-service-flagname",
57-
DefaultDeploy: true,
5857
Handle: "some-handle",
5958
Script: "/path/to/some-script",
6059
Deployment: "some-deployment",
6160
},
6261
{
6362
Name: "some-other-service",
6463
Flagname: "some-other-service-flagname",
65-
DefaultDeploy: false,
6664
Handle: "some-other-handle",
6765
Script: "/path/to/some-other-script",
6866
Deployment: "some-other-deployment",

provision/services.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
type Service struct {
1616
Name string `yaml:"name"`
1717
Flagname string `yaml:"flag_name"`
18-
DefaultDeploy bool `yaml:"default_deploy"`
1918
Handle string `yaml:"handle"` //TODO <-- remove
2019
Script string `yaml:"script"`
2120
Deployment string `yaml:"deployment"`
@@ -34,15 +33,7 @@ func (c *Controller) WhiteListServices(whiteList string, services []Service) ([]
3433
switch strings.TrimSpace(strings.ToLower(whiteList)) {
3534
case "all":
3635
return services, nil
37-
case "none":
38-
return whiteListed, nil
39-
case "":
40-
for _, service := range services {
41-
if service.DefaultDeploy && !contains(whiteListed, service.Name) {
42-
whiteListed = append(whiteListed, service)
43-
}
44-
}
45-
36+
case "", "none":
4637
return whiteListed, nil
4738
default:
4839
for _, service := range services {

provision/services_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,27 @@ var _ = Describe("When progress whitelist is called with", func() {
2020
{
2121
Name: "service-one",
2222
Flagname: "service-one-flagname",
23-
DefaultDeploy: true,
2423
Handle: "service-one-handle",
2524
Script: "/path/to/some-script",
2625
Deployment: "some-deployment",
2726
},
2827
{
2928
Name: "service-two",
3029
Flagname: "service-two-flagname",
31-
DefaultDeploy: false,
3230
Handle: "service-two-handle",
3331
Script: "/path/to/some-script",
3432
Deployment: "some-deployment",
3533
},
3634
{
3735
Name: "service-three",
3836
Flagname: "service-three-flagname",
39-
DefaultDeploy: true,
4037
Handle: "service-three-handle",
4138
Script: "/path/to/some-script",
4239
Deployment: "some-deployment",
4340
},
4441
{
4542
Name: "service-four",
4643
Flagname: "always-include",
47-
DefaultDeploy: true,
4844
Handle: "service-four-handle",
4945
Script: "/path/to/some-script",
5046
Deployment: "some-deployment",
@@ -53,14 +49,12 @@ var _ = Describe("When progress whitelist is called with", func() {
5349
})
5450

5551
Context("an empty string", func() {
56-
It("returns all and only the DefaultDeploy services", func() {
52+
It("returns only the DefaultDeploy services", func() {
5753
output, err := c.WhiteListServices("", services)
5854
Expect(err).ToNot(HaveOccurred())
5955

60-
Expect(len(output)).To(Equal(3))
56+
Expect(len(output)).To(Equal(1))
6157
Expect(output[0].Name).To(Equal("service-four"))
62-
Expect(output[1].Name).To(Equal("service-one"))
63-
Expect(output[2].Name).To(Equal("service-three"))
6458
})
6559
})
6660

0 commit comments

Comments
 (0)