Skip to content

Commit

Permalink
fix: Update 'import' deprecation warning with a date. (#572)
Browse files Browse the repository at this point in the history
Putting a date in the deprecation warning message allows users
to plan migration more effectively.  The date chosen allows
for plenty of time for users to migrate existing stacker.yaml files.

Signed-off-by: Scott Moser <smoser@brickies.net>
  • Loading branch information
smoser authored Dec 14, 2023
1 parent b6996fd commit 0a82ed4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/stacker_yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ The deprecated `import` directive works like `imports` except that
the entries in the `import` array will be placed into `/stacker/` rather
than `/stacker/imports`.

See https://github.com/project-stacker/stacker/issues/571 for timeline and migration info.

### `overlay_dirs`
This directive works only with OverlayFS backend storage.

Expand Down
7 changes: 5 additions & 2 deletions pkg/types/stackerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,11 @@ func NewStackerfile(stackerfile string, validateHash bool, substitutions []strin
for _, name := range sf.FileOrder {
layer := sf.internal[name]
if layer.WasLegacyImport() {
log.Warnf("Deprecated 'import' directive used in layer '%s' of file '%s'. "+
"Change from 'import' to 'imports', and '/stacker/' to '/stacker/imports/'", name, stackerfile)
log.Warnf("'import' directive used in layer '%s' inside file '%s' is deprecated. "+
"Support for 'import' will be removed in releases after 2025-01-01. "+
"Migrate by changing 'import' to 'imports' and '/stacker' to '/stacker/imports'. "+
"See https://github.com/project-stacker/stacker/issues/571 for migration.",
name, stackerfile)
}
}

Expand Down

0 comments on commit 0a82ed4

Please sign in to comment.