Allow dump generator to add LXC templates
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
c3047d252d
commit
be0f1011c6
@ -15,7 +15,16 @@ type DumpGenerator struct{}
|
|||||||
// RunLXC dumps content to a file.
|
// RunLXC dumps content to a file.
|
||||||
func (g DumpGenerator) RunLXC(cacheDir, sourceDir string, img *image.LXCImage,
|
func (g DumpGenerator) RunLXC(cacheDir, sourceDir string, img *image.LXCImage,
|
||||||
defFile shared.DefinitionFile) error {
|
defFile shared.DefinitionFile) error {
|
||||||
return g.Run(cacheDir, sourceDir, defFile)
|
err := g.Run(cacheDir, sourceDir, defFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if defFile.Templated {
|
||||||
|
return img.AddTemplate(defFile.Path)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunLXD dumps content to a file.
|
// RunLXD dumps content to a file.
|
||||||
|
@ -96,6 +96,7 @@ type DefinitionFile struct {
|
|||||||
Releases []string `yaml:"releases,omitempty"`
|
Releases []string `yaml:"releases,omitempty"`
|
||||||
Name string `yaml:"name,omitempty"`
|
Name string `yaml:"name,omitempty"`
|
||||||
Template DefinitionFileTemplate `yaml:"template,omitempty"`
|
Template DefinitionFileTemplate `yaml:"template,omitempty"`
|
||||||
|
Templated bool `yaml:"templated,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A DefinitionFileTemplate represents the settings used by generators
|
// A DefinitionFileTemplate represents the settings used by generators
|
||||||
|
Loading…
Reference in New Issue
Block a user