@@ -17,6 +17,7 @@ const appSettingsFixture string = `
1717 "owner": "test",
1818 "app": "example-go",
1919 "routable": true,
20+ "autorollback": true,
2021 "allowlist": ["1.2.3.4", "0.0.0.0/0"],
2122 "autoscale": {"cmd": {"min": 3, "max": 8, "cpu_percent": 40}},
2223 "label": {"git_repo": "https://github.com/drycc/controller-sdk-go", "team" : "drycc"},
@@ -31,6 +32,7 @@ const appSettingsUnsetFixture string = `
3132 "owner": "test",
3233 "app": "unset-test",
3334 "routable": true,
35+ "autorollback": true,
3436 "allowlist": ["1.2.3.4", "0.0.0.0/0"],
3537 "autoscale": {"cmd": {"min": 3, "max": 8, "cpu_percent": 40}},
3638 "label": {"git_repo": "https://github.com/drycc/controller-sdk-go", "team" : "drycc"},
@@ -39,8 +41,8 @@ const appSettingsUnsetFixture string = `
3941 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
4042}
4143`
42- const appSettingsSetExpected string = `{"routable":true,"allowlist":["1.2.3.4","0.0.0.0/0"],"autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}},"label":{"git_repo":"https://github.com/drycc/controller-sdk-go","team":"drycc"}}`
43- const appSettingsUnsetExpected string = `{"routable":true,"allowlist":["1.2.3.4","0.0.0.0/0"],"autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}},"label":{"git_repo":"https://github.com/drycc/controller-sdk-go","team":"drycc"}}`
44+ const appSettingsSetExpected string = `{"routable":true,"allowlist":["1.2.3.4","0.0.0.0/0"],"autorollback":true," autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}},"label":{"git_repo":"https://github.com/drycc/controller-sdk-go","team":"drycc"}}`
45+ const appSettingsUnsetExpected string = `{"routable":true,"allowlist":["1.2.3.4","0.0.0.0/0"],"autorollback":true," autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}},"label":{"git_repo":"https://github.com/drycc/controller-sdk-go","team":"drycc"}}`
4446
4547type fakeHTTPServer struct {}
4648
@@ -112,10 +114,11 @@ func TestAppSettingsSet(t *testing.T) {
112114 }
113115
114116 expected := api.AppSettings {
115- Owner : "test" ,
116- App : "example-go" ,
117- Routable : api .NewRoutable (),
118- Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
117+ Owner : "test" ,
118+ App : "example-go" ,
119+ Routable : api .NewRoutable (),
120+ Autorollback : api .NewAutorollback (),
121+ Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
119122 Autoscale : map [string ]* api.Autoscale {
120123 "cmd" : {
121124 Min : 3 ,
@@ -133,8 +136,9 @@ func TestAppSettingsSet(t *testing.T) {
133136 }
134137
135138 appSettingsVars := api.AppSettings {
136- Routable : api .NewRoutable (),
137- Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
139+ Routable : api .NewRoutable (),
140+ Autorollback : api .NewAutorollback (),
141+ Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
138142 Autoscale : map [string ]* api.Autoscale {
139143 "cmd" : {
140144 Min : 3 ,
@@ -172,10 +176,11 @@ func TestAppSettingsUnset(t *testing.T) {
172176 }
173177
174178 expected := api.AppSettings {
175- Owner : "test" ,
176- App : "unset-test" ,
177- Routable : api .NewRoutable (),
178- Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
179+ Owner : "test" ,
180+ App : "unset-test" ,
181+ Routable : api .NewRoutable (),
182+ Autorollback : api .NewAutorollback (),
183+ Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
179184 Autoscale : map [string ]* api.Autoscale {
180185 "cmd" : {
181186 Min : 3 ,
@@ -193,8 +198,9 @@ func TestAppSettingsUnset(t *testing.T) {
193198 }
194199
195200 appSettingsVars := api.AppSettings {
196- Routable : api .NewRoutable (),
197- Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
201+ Routable : api .NewRoutable (),
202+ Autorollback : api .NewAutorollback (),
203+ Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
198204 Autoscale : map [string ]* api.Autoscale {
199205 "cmd" : {
200206 Min : 3 ,
@@ -232,10 +238,11 @@ func TestAppSettingsList(t *testing.T) {
232238 }
233239
234240 expected := api.AppSettings {
235- Owner : "test" ,
236- App : "example-go" ,
237- Routable : api .NewRoutable (),
238- Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
241+ Owner : "test" ,
242+ App : "example-go" ,
243+ Routable : api .NewRoutable (),
244+ Autorollback : api .NewAutorollback (),
245+ Allowlist : []string {"1.2.3.4" , "0.0.0.0/0" },
239246 Autoscale : map [string ]* api.Autoscale {
240247 "cmd" : {
241248 Min : 3 ,
0 commit comments