@@ -20,6 +20,11 @@ const configFixture string = `
2020 "TEST": "testing",
2121 "FOO": "bar"
2222 },
23+ "typed_values": {
24+ "web": {
25+ "PORT": "9000"
26+ }
27+ },
2328 "limits": {
2429 "web": "std1.xlarge.c1m1"
2530 },
@@ -40,6 +45,7 @@ const configUnsetFixture string = `
4045 "owner": "test",
4146 "app": "unset-test",
4247 "values": {},
48+ "typed_values": {"web":{"PORT":null}},
4349 "limits": {},
4450 "tags": {},
4551 "registry": {},
@@ -49,8 +55,8 @@ const configUnsetFixture string = `
4955}
5056`
5157
52- const configSetExpected string = `{"values":{"FOO":"bar","TEST":"testing"},"limits":{"web":"std1.xlarge.c1m1"},"tags":{"test":"tests"},"registry":{"username":"bob"}}`
53- const configUnsetExpected string = `{"values":{"FOO":null,"TEST":null},"limits":{"web":null},"tags":{"test":null},"registry":{"username":null}}`
58+ const configSetExpected string = `{"values":{"FOO":"bar","TEST":"testing"},"typed_values":{"web":{"PORT":"9000"}}," limits":{"web":"std1.xlarge.c1m1"},"tags":{"test":"tests"},"registry":{"username":"bob"}}`
59+ const configUnsetExpected string = `{"values":{"FOO":null,"TEST":null},"typed_values":{"web":{"PORT":null}}," limits":{"web":null},"tags":{"test":null},"registry":{"username":null}}`
5460
5561type fakeHTTPServer struct {}
5662
@@ -124,10 +130,13 @@ func TestConfigSet(t *testing.T) {
124130 expected := api.Config {
125131 Owner : "test" ,
126132 App : "example-go" ,
127- Values : map [ string ] interface {} {
133+ Values : api. ConfigValues {
128134 "TEST" : "testing" ,
129135 "FOO" : "bar" ,
130136 },
137+ TypedValues : map [string ]api.ConfigValues {
138+ "web" : {"PORT" : "9000" },
139+ },
131140 Limits : map [string ]interface {}{
132141 "web" : "std1.xlarge.c1m1" ,
133142 },
@@ -143,10 +152,13 @@ func TestConfigSet(t *testing.T) {
143152 }
144153
145154 configVars := api.Config {
146- Values : map [ string ] interface {} {
155+ Values : api. ConfigValues {
147156 "TEST" : "testing" ,
148157 "FOO" : "bar" ,
149158 },
159+ TypedValues : map [string ]api.ConfigValues {
160+ "web" : {"PORT" : "9000" },
161+ },
150162 Limits : map [string ]interface {}{
151163 "web" : "std1.xlarge.c1m1" ,
152164 },
@@ -182,9 +194,12 @@ func TestConfigUnset(t *testing.T) {
182194 }
183195
184196 expected := api.Config {
185- Owner : "test" ,
186- App : "unset-test" ,
187- Values : map [string ]interface {}{},
197+ Owner : "test" ,
198+ App : "unset-test" ,
199+ Values : map [string ]interface {}{},
200+ TypedValues : map [string ]api.ConfigValues {
201+ "web" : {"PORT" : nil },
202+ },
188203 Limits : map [string ]interface {}{},
189204 Tags : map [string ]interface {}{},
190205 Registry : map [string ]interface {}{},
@@ -198,6 +213,9 @@ func TestConfigUnset(t *testing.T) {
198213 "TEST" : nil ,
199214 "FOO" : nil ,
200215 },
216+ TypedValues : map [string ]api.ConfigValues {
217+ "web" : {"PORT" : nil },
218+ },
201219 Limits : map [string ]interface {}{
202220 "web" : nil ,
203221 },
@@ -239,6 +257,9 @@ func TestConfigList(t *testing.T) {
239257 "TEST" : "testing" ,
240258 "FOO" : "bar" ,
241259 },
260+ TypedValues : map [string ]api.ConfigValues {
261+ "web" : {"PORT" : "9000" },
262+ },
242263 Limits : map [string ]interface {}{
243264 "web" : "std1.xlarge.c1m1" ,
244265 },
0 commit comments