File tree 1 file changed +1
-21
lines changed
controllers/nginx/pkg/cmd/controller
1 file changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ import (
29
29
"time"
30
30
31
31
"github.com/golang/glog"
32
- "github.com/mitchellh/mapstructure"
33
32
"github.com/spf13/pflag"
34
33
35
34
"k8s.io/kubernetes/pkg/api"
@@ -186,26 +185,7 @@ func (n NGINXController) BackendDefaults() defaults.Backend {
186
185
return d .Backend
187
186
}
188
187
189
- return n .backendDefaults ()
190
- }
191
-
192
- func (n * NGINXController ) backendDefaults () defaults.Backend {
193
- d := config .NewDefault ()
194
- config := & mapstructure.DecoderConfig {
195
- Metadata : nil ,
196
- WeaklyTypedInput : true ,
197
- Result : & d ,
198
- TagName : "json" ,
199
- }
200
- decoder , err := mapstructure .NewDecoder (config )
201
- if err != nil {
202
- glog .Warningf ("unexpected error merging defaults: %v" , err )
203
- }
204
- err = decoder .Decode (n .configmap .Data )
205
- if err != nil {
206
- glog .Warningf ("unexpected error decoding: %v" , err )
207
- }
208
- return d .Backend
188
+ return ngx_template .ReadConfig (n .configmap .Data ).Backend
209
189
}
210
190
211
191
// isReloadRequired check if the new configuration file is different
You can’t perform that action at this time.
0 commit comments