import
directive is deprecated and replaced by imports
.
#571
Labels
import
directive is deprecated and replaced by imports
.
#571
Deprecation of
import
directiveThe
import
directive instacker.yaml
files is deprecated. It is replaced byimports
(plural).Support for
import
will not be present in any stacker release made after 2025-01-01.The
import
directive contained all the functionality of theimports
directive in stacker releases up until 0.4.0 and initial release of the 1.0 branch. 1.0 pre-releases contain a warning on use ofimport
. Users must migrate toimports
directive.Migration path
In order to change from
import
toimports
the user will:import
in stacker.yaml files toimports
run
section from/stacker/<path>
to/stacker/imports/<path>
.As an example, consider this old
stacker-old.yaml
file:Building the above
stacker-old.yaml
file will give a deprecation warning.To use
imports
, the newstacker.yaml
would look like this:The changes are highlighted in this diff:
Reason for change
The reason behind the change from
import
toimports
was to be consistent with other stacker top level directives that contained a dictionary or list (binds
,labels
).The more invasive change of
/stacker
to/stacker/imports
was necessary to provide a clean namespace forstacker
inside a container during layer build. Asstacker
grew more functionality, it needed to be able to utilize the/stacker
namespace safely without colliding with user-provided input. With user provided paths in/stacker
, this was not possible.As an example of this,
stacker
now creates/stacker/bin/
directory for its own use. If a user's stacker.yaml file included animport
ofbin/
, then stacker would collide on that namespace. Rather than put restrictions on filenames or paths that a user could import, stacker confines those imports to/stacker/imports
and gives the user full control of that namespace.The text was updated successfully, but these errors were encountered: