refactor: added coredhcp default generator
This commit is contained in:
parent
93cf6bba12
commit
6bf75e27ce
1 changed files with 3 additions and 2 deletions
|
|
@ -35,7 +35,7 @@ func createDefaultGenerators() map[string]Generator {
|
||||||
var (
|
var (
|
||||||
generatorMap = map[string]Generator{}
|
generatorMap = map[string]Generator{}
|
||||||
generators = []Generator{
|
generators = []Generator{
|
||||||
&Conman{}, &DHCPd{}, &DNSMasq{}, &Warewulf{}, &Example{},
|
&Conman{}, &DHCPd{}, &DNSMasq{}, &Warewulf{}, &Example{}, &CoreDhcp{},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
for _, g := range generators {
|
for _, g := range generators {
|
||||||
|
|
@ -171,10 +171,11 @@ func Generate(plugin string, params Params) (FileMap, error) {
|
||||||
)
|
)
|
||||||
|
|
||||||
// check if generator is built-in first before loading external plugin
|
// check if generator is built-in first before loading external plugin
|
||||||
|
log.Debug().Any("generators", DefaultGenerators).Msg("available generators")
|
||||||
gen, ok = DefaultGenerators[plugin]
|
gen, ok = DefaultGenerators[plugin]
|
||||||
if !ok {
|
if !ok {
|
||||||
// only load the plugin needed for this target if we don't find default
|
// only load the plugin needed for this target if we don't find default
|
||||||
log.Error().Msg("could not find target in default generators")
|
log.Error().Str("plugin", plugin).Msg("could not find target in default generators")
|
||||||
gen, err = LoadPlugin(plugin)
|
gen, err = LoadPlugin(plugin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to load plugin from file: %v", err)
|
return nil, fmt.Errorf("failed to load plugin from file: %v", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue