Use CurrentController
@@ -228,13 +228,9 @@ func mergeString(m map[string][]byte, key, value string) {
}
func (o *GeneratorOptions) readConfig() (*config.Controller, map[string][]byte, error) {
- // Read the initial information from the configuration
r := o.Config.Reader()
- controllerName, err := r.ControllerName(r.ContextName())
- if err != nil {
- return nil, nil, err
- }
- ctrl, err := r.Controller(controllerName)
+
+ ctrl, err := config.CurrentController(r)
if err != nil {
return nil, nil, err
}
@@ -243,6 +239,7 @@ func (o *GeneratorOptions) readConfig() (*config.Controller, map[string][]byte,
if err != nil {
return nil, nil, err
}
+
return &ctrl, data, nil
}
