-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple running deprecated migrations and adding package warnings fr…
…om readZarfYAML The goal here is separation of concerns
- Loading branch information
Lucas Rodriguez
committed
Jan 11, 2024
1 parent
83a3cf2
commit f8e6569
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors | ||
|
||
// Package packager contains functions for interacting with, managing and deploying Zarf packages. | ||
package packager | ||
|
||
import "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" | ||
|
||
func (p *Packager) runMigrations() { | ||
var warnings []string | ||
|
||
if len(p.cfg.Pkg.Build.Migrations) > 0 { | ||
for idx, component := range p.cfg.Pkg.Components { | ||
// Handle component configuration deprecations | ||
p.cfg.Pkg.Components[idx], warnings = deprecated.MigrateComponent(p.cfg.Pkg.Build, component) | ||
p.warnings = append(p.warnings, warnings...) | ||
} | ||
} | ||
} |