saltstack / saltstack/salt

[BUG] state.highstate ignores its whitelist argument when using salt-ssh

Open
#62,011 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Running salt <target> state.highstate whitelist=<state> works fine.
Running salt-ssh <target> state.highstate whitelist=<state> tries to apply all states, as if the whitelist argument were ignored.

Setup
Tested from a systemd-nspawn container running Debian 11.3 with packages salt-{common,master,minion,ssh} 3002.6+dfsg1-4+deb11u1. A brief look at Debian-specific patches makes me think they are not the culprit.
The target machine is a Debian Sid bare metal host. It used to run a salt-minion instance but here, I wanted to experiment with salt-ssh.
The issue does not seem state-specific, so I am not going to provide SLS files.

Steps to Reproduce the behavior
salt --state-output=changes lambda.mydomain.tld state.highstate test=yes whitelist=foobar
=> I get a list of 22 changes, and all of them are related to the foobar SLS.
salt-ssh --state-output=changes target.mydomain.tld state.highstate test=yes whitelist=foobar
=> I get a huge list of 406 changes; 22 of them are related to the foobar SLS, all others are unrelated.
=> unchanged=14 reflects that test=yes was taken into account
=> the list itself clearly shows that whitelist=foobar was ignored.

Debug logs may be relevant but will likely be too lengthy considering the sheer number of changes Salt ends up applying. If needed and requested, I will provide a filtered/abridged version.

Expected behavior
I expected only changes related to foobar in the output of the saLt-ssh command.

Screenshots
None.

Versions Report

Salt Version:
          Salt: 3002.6

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.3
       libgit2: 1.1.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.0
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.9.7
        pygit2: 1.4.0
        Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
  python-gnupg: Not Installed
        PyYAML: 5.3.1
         PyZMQ: 20.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: debian 11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.17.0-1-amd64
        system: Linux
       version: Debian GNU/Linux 11 bullseye

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two state.highstate commands from the issue, comparing salt and salt-ssh with whitelist=foobar and test=yes. Trace the salt-ssh state.highstate entry point to find where whitelist handling diverges; done means salt-ssh reports or applies only the foobar SLS changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.