Skip to content

Commit 03ebf57

Browse files
mvo5supakeen
authored andcommitted
distro,manifest: have a single LoraxTemplates type
We had two identical copies of the LoraxTemplates type, one in distro and one in manifest. This makes working with this type harder as they cannot be assigned and there is also the risk of drift. Given that they are identical lets just merge them.
1 parent 500f77c commit 03ebf57

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

pkg/distro/generic/images.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,7 @@ func installerCustomizations(t *imageType, c *blueprint.Customizations) (manifes
391391
isc.ISOBoot = *isoboot
392392
}
393393

394-
for _, tmpl := range installerConfig.LoraxTemplates {
395-
isc.LoraxTemplates = append(isc.LoraxTemplates, manifest.InstallerLoraxTemplate{
396-
Path: tmpl.Path,
397-
AfterDracut: tmpl.AfterDracut,
398-
})
399-
}
400-
394+
isc.LoraxTemplates = installerConfig.LoraxTemplates
401395
if pkg := installerConfig.LoraxTemplatePackage; pkg != nil {
402396
isc.LoraxTemplatePackage = *pkg
403397
}

pkg/distro/installer_config.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,10 @@ type InstallerConfig struct {
2828
ISOBootType *manifest.ISOBootType `yaml:"iso_boot_type,omitempty"`
2929

3030
// Lorax template settings for org.osbuild.lorax stage
31-
LoraxTemplates []InstallerLoraxTemplate `yaml:"lorax_templates,omitempty"`
32-
LoraxTemplatePackage *string `yaml:"lorax_template_package"`
33-
LoraxLogosPackage *string `yaml:"lorax_logos_package"`
34-
LoraxReleasePackage *string `yaml:"lorax_release_package"`
35-
}
36-
37-
type InstallerLoraxTemplate struct {
38-
Path string `yaml:"path"`
39-
AfterDracut bool `yaml:"after_dracut,omitempty"`
31+
LoraxTemplates []manifest.InstallerLoraxTemplate `yaml:"lorax_templates,omitempty"`
32+
LoraxTemplatePackage *string `yaml:"lorax_template_package"`
33+
LoraxLogosPackage *string `yaml:"lorax_logos_package"`
34+
LoraxReleasePackage *string `yaml:"lorax_release_package"`
4035
}
4136

4237
// InheritFrom inherits unset values from the provided parent configuration and

pkg/manifest/installer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type InstallerCustomizations struct {
3636
}
3737

3838
type InstallerLoraxTemplate struct {
39-
Path string
40-
AfterDracut bool // Should this template be executed after dracut? Defaults to not.
39+
Path string `yaml:"path"`
40+
// Should this template be executed after dracut? Defaults to not.
41+
AfterDracut bool `yaml:"after_dracut,omitempty"`
4142
}

0 commit comments

Comments
 (0)