Skip to content

Commit

Permalink
Move legacy layout warning logic to runMigrations
Browse files Browse the repository at this point in the history
Goal here is separation of concerns
  • Loading branch information
Lucas Rodriguez committed Jan 11, 2024
1 parent f8e6569 commit 99cb14e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/pkg/packager/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated"
func (p *Packager) runMigrations() {
var warnings []string

if p.layout.IsLegacyLayout() {
warning := "Detected deprecated package layout, migrating to new layout - support for this package will be dropped in v1.0.0"
p.warnings = append(p.warnings, warning)
}

if len(p.cfg.Pkg.Build.Migrations) > 0 {
for idx, component := range p.cfg.Pkg.Components {
// Handle component configuration deprecations
Expand Down
7 changes: 0 additions & 7 deletions src/pkg/packager/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ func (p *Packager) readZarfYAML(path string) error {
if err := utils.ReadYaml(path, &p.cfg.Pkg); err != nil {
return err
}

if p.layout.IsLegacyLayout() {
warning := "Detected deprecated package layout, migrating to new layout - support for this package will be dropped in v1.0.0"
p.warnings = append(p.warnings, warning)
}

p.arch = config.GetArch(p.cfg.Pkg.Metadata.Architecture, p.cfg.Pkg.Build.Architecture)

return nil
}

Expand Down

0 comments on commit 99cb14e

Please sign in to comment.