Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra_filerefs to sls_build #47148

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions salt/modules/dockermod.py
Original file line number Diff line number Diff line change
Expand Up @@ -6558,15 +6558,15 @@ def _generate_tmp_path():
'salt.docker.{0}'.format(uuid.uuid4().hex[:6]))


def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None):
def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=''):
'''
Prepares a self contained tarball that has the state
to be applied in the container
'''
chunks = _compile_state(sls_opts, mods)
# reuse it from salt.ssh, however this function should
# be somewhere else
refs = salt.client.ssh.state.lowstate_file_refs(chunks)
refs = salt.client.ssh.state.lowstate_file_refs(chunks, extra_filerefs)
_mk_fileclient()
trans_tar = salt.client.ssh.state.prep_trans_tar(
sls_opts,
Expand Down Expand Up @@ -6757,7 +6757,8 @@ def sls(name, mods=None, **kwargs):
name,
sls_opts,
mods=mods,
pillar=pillar)
pillar=pillar,
extra_filerefs=kwargs.get('extra_filerefs', ''))

# where to put the salt trans tar
trans_dest_path = _generate_tmp_path()
Expand Down Expand Up @@ -6890,7 +6891,7 @@ def sls_build(repository,
repository = name

create_kwargs = __utils__['args.clean_kwargs'](**copy.deepcopy(kwargs))
for key in ('image', 'name', 'cmd', 'interactive', 'tty'):
for key in ('image', 'name', 'cmd', 'interactive', 'tty', 'extra_filerefs'):
try:
del create_kwargs[key]
except KeyError:
Expand Down