Merge 3006.x into 3007.x

This commit is contained in:
Pedro Algarvio 2024-01-31 11:05:43 +00:00
commit 4691317034
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
14 changed files with 172 additions and 163 deletions

View file

@ -2263,6 +2263,14 @@ jobs:
distro: ubuntu
version: "22.04"
arch: arm64
- pkg-type: deb
distro: ubuntu
version: "23.04"
arch: x86_64
- pkg-type: deb
distro: ubuntu
version: "23.04"
arch: arm64
steps:
- uses: actions/checkout@v4
@ -2376,54 +2384,6 @@ jobs:
distro: amazon
version: "2023"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "7"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "7"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "7"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "8"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "8"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "8"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "9"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "9"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "9"
arch: aarch64
- pkg-type: rpm
distro: fedora
version: "36"
arch: x86_64
- pkg-type: rpm
distro: fedora
version: "36"
arch: arm64
- pkg-type: rpm
distro: fedora
version: "36"
arch: aarch64
- pkg-type: rpm
distro: fedora
version: "37"
@ -2484,6 +2444,42 @@ jobs:
distro: photon
version: "5"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "7"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "7"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "7"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "8"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "8"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "8"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "9"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "9"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "9"
arch: aarch64
steps:
- uses: actions/checkout@v4

View file

@ -2103,6 +2103,14 @@ jobs:
distro: ubuntu
version: "22.04"
arch: arm64
- pkg-type: deb
distro: ubuntu
version: "23.04"
arch: x86_64
- pkg-type: deb
distro: ubuntu
version: "23.04"
arch: arm64
steps:
- uses: actions/checkout@v4
@ -2216,54 +2224,6 @@ jobs:
distro: amazon
version: "2023"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "7"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "7"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "7"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "8"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "8"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "8"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "9"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "9"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "9"
arch: aarch64
- pkg-type: rpm
distro: fedora
version: "36"
arch: x86_64
- pkg-type: rpm
distro: fedora
version: "36"
arch: arm64
- pkg-type: rpm
distro: fedora
version: "36"
arch: aarch64
- pkg-type: rpm
distro: fedora
version: "37"
@ -2324,6 +2284,42 @@ jobs:
distro: photon
version: "5"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "7"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "7"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "7"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "8"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "8"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "8"
arch: aarch64
- pkg-type: rpm
distro: redhat
version: "9"
arch: x86_64
- pkg-type: rpm
distro: redhat
version: "9"
arch: arm64
- pkg-type: rpm
distro: redhat
version: "9"
arch: aarch64
steps:
- uses: actions/checkout@v4

View file

@ -86,7 +86,7 @@ jobs:
- name: Download Onedir Tarball as an Artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.xz
path: artifacts/
- name: Decompress Onedir Tarball
@ -94,12 +94,12 @@ jobs:
run: |
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
cd artifacts
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.xz
- name: Download nox.linux.${{ matrix.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
- name: Download nox.linux.${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
uses: actions/download-artifact@v4
with:
name: nox-linux-${{ matrix.arch }}-${{ inputs.nox-session }}
name: nox-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}-${{ inputs.nox-session }}
- name: Setup Python Tools Scripts
uses: ./.github/actions/setup-python-tools-scripts

View file

@ -231,7 +231,7 @@ jobs:
- name: Download Onedir Tarball as an Artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.xz
path: artifacts/
- name: Decompress Onedir Tarball
@ -239,12 +239,12 @@ jobs:
run: |
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
cd artifacts
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.xz
- name: Download nox.linux.${{ matrix.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
- name: Download nox.linux.${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
uses: actions/download-artifact@v4
with:
name: nox-linux-${{ matrix.arch }}-${{ inputs.nox-session }}
name: nox-linux-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}-${{ inputs.nox-session }}
- name: Setup Python Tools Scripts
uses: ./.github/actions/setup-python-tools-scripts

View file

@ -0,0 +1 @@
Deprecate and stop using ``salt.features``

View file

@ -14,6 +14,7 @@ from copy import deepcopy
import salt.defaults.exitcodes
import salt.exceptions
import salt.features
import salt.syspaths
import salt.utils.data
import salt.utils.dictupdate
@ -1310,6 +1311,7 @@ DEFAULT_MINION_OPTS = immutabletypes.freeze(
"global_state_conditions": None,
"reactor_niceness": None,
"fips_mode": False,
"features": {},
}
)
@ -1658,6 +1660,7 @@ DEFAULT_MASTER_OPTS = immutabletypes.freeze(
"cluster_id": None,
"cluster_peers": [],
"cluster_pki_dir": None,
"features": {},
}
)
@ -1692,6 +1695,7 @@ DEFAULT_PROXY_MINION_OPTS = immutabletypes.freeze(
"pki_dir": os.path.join(salt.syspaths.LIB_STATE_DIR, "pki", "proxy"),
"cachedir": os.path.join(salt.syspaths.CACHE_DIR, "proxy"),
"sock_dir": os.path.join(salt.syspaths.SOCK_DIR, "proxy"),
"features": {},
}
)
@ -1725,6 +1729,7 @@ DEFAULT_CLOUD_OPTS = immutabletypes.freeze(
"log_rotate_backup_count": 0,
"bootstrap_delay": 0,
"cache": "localfs",
"features": {},
}
)
@ -2335,6 +2340,7 @@ def minion_config(
if role != "master":
apply_sdb(opts)
_validate_opts(opts)
salt.features.setup_features(opts)
return opts
@ -2346,6 +2352,7 @@ def mminion_config(path, overrides, ignore_config_errors=True):
_validate_opts(opts)
opts["grains"] = salt.loader.grains(opts)
opts["pillar"] = {}
salt.features.setup_features(opts)
return opts
@ -2432,6 +2439,7 @@ def proxy_config(
apply_sdb(opts)
_validate_opts(opts)
salt.features.setup_features(opts)
return opts
@ -2509,6 +2517,7 @@ def syndic_config(
if urllib.parse.urlparse(opts.get(config_key, "")).scheme == "":
prepend_root_dirs.append(config_key)
prepend_root_dir(opts, prepend_root_dirs)
salt.features.setup_features(opts)
return opts
@ -2761,6 +2770,7 @@ def cloud_config(
prepend_root_dirs.append(opts["log_file"])
prepend_root_dir(opts, prepend_root_dirs)
salt.features.setup_features(opts)
# Return the final options
return opts
@ -3936,6 +3946,7 @@ def master_config(
if salt.utils.data.is_dictlist(opts["nodegroups"]):
opts["nodegroups"] = salt.utils.data.repack_dictlist(opts["nodegroups"])
apply_sdb(opts)
salt.features.setup_features(opts)
return opts
@ -4198,6 +4209,7 @@ def client_config(path, env_var="SALT_CLIENT_CONFIG", defaults=None):
# Return the client options
_validate_opts(opts)
salt.features.setup_features(opts)
return opts
@ -4221,6 +4233,7 @@ def api_config(path):
)
prepend_root_dir(opts, ["api_pidfile", "api_logfile", "log_file", "pidfile"])
salt.features.setup_features(opts)
return opts

View file

@ -21,6 +21,14 @@ class Features:
log.warning("Features already setup")
def get(self, key, default=None):
import salt.utils.versions
salt.utils.versions.warn_until(
3008,
"Please stop checking feature flags using 'salt.features' and instead "
"check the 'features' keyword on the configuration dictionary. The "
"'salt.features' module will go away in {version}.",
)
return self.features.get(key, default)

View file

@ -33,7 +33,6 @@ import salt.syspaths
import salt.utils.data
import salt.utils.event
import salt.utils.versions
from salt.features import features
log = logging.getLogger(__name__)
@ -812,11 +811,11 @@ def runner(name, **kwargs):
"executed" if success else "failed",
)
if features.get("enable_deprecated_orchestration_flag", False):
if __opts__["features"].get("enable_deprecated_orchestration_flag", False):
ret["__orchestration__"] = True
salt.utils.versions.warn_until(
3008,
"The __orchestration__ return flag will be removed in Salt Argon. "
"The __orchestration__ return flag will be removed in {version}. "
"For more information see https://github.com/saltstack/salt/pull/59917.",
)
@ -1061,7 +1060,7 @@ def wheel(name, **kwargs):
"executed" if success else "failed",
)
if features.get("enable_deprecated_orchestration_flag", False):
if __opts__["features"].get("enable_deprecated_orchestration_flag", False):
ret["__orchestration__"] = True
salt.utils.versions.warn_until(
3008,

View file

@ -191,7 +191,6 @@ import re
import salt.exceptions
import salt.utils.versions
from salt.features import features
try:
from M2Crypto.RSA import RSAError
@ -205,7 +204,7 @@ def __virtual__():
"""
only load this module if the corresponding execution module is loaded
"""
if features.get("x509_v2"):
if __opts__["features"].get("x509_v2"):
return (False, "Superseded, using x509_v2")
if "x509.get_pem_entry" in __salt__:
salt.utils.versions.warn_until(

View file

@ -188,7 +188,6 @@ import os.path
import salt.utils.files
from salt.exceptions import CommandExecutionError, SaltInvocationError
from salt.features import features
from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS
try:
@ -211,7 +210,7 @@ __virtualname__ = "x509"
def __virtual__():
if not HAS_CRYPTOGRAPHY:
return (False, "Could not load cryptography")
if not features.get("x509_v2"):
if not __opts__["features"].get("x509_v2"):
return (
False,
"x509_v2 needs to be explicitly enabled by setting `x509_v2: true` "

View file

@ -25,7 +25,6 @@ import salt._logging
import salt.config as config
import salt.defaults.exitcodes
import salt.exceptions
import salt.features
import salt.syspaths as syspaths
import salt.utils.args
import salt.utils.data
@ -1931,9 +1930,7 @@ class MasterOptionParser(
_default_logging_logfile_ = config.DEFAULT_MASTER_OPTS["log_file"]
def setup_config(self):
opts = config.master_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return config.master_config(self.get_config_file_path())
class MinionOptionParser(
@ -1948,13 +1945,11 @@ class MinionOptionParser(
_default_logging_logfile_ = config.DEFAULT_MINION_OPTS["log_file"]
def setup_config(self):
opts = config.minion_config(
return config.minion_config(
self.get_config_file_path(), # pylint: disable=no-member
cache_minion_id=True,
ignore_config_errors=False,
)
salt.features.setup_features(opts)
return opts
class ProxyMinionOptionParser(
@ -1985,11 +1980,9 @@ class ProxyMinionOptionParser(
except AttributeError:
minion_id = None
opts = config.proxy_config(
return config.proxy_config(
self.get_config_file_path(), cache_minion_id=False, minion_id=minion_id
)
salt.features.setup_features(opts)
return opts
class SyndicOptionParser(
@ -2019,11 +2012,9 @@ class SyndicOptionParser(
]
def setup_config(self):
opts = config.syndic_config(
return config.syndic_config(
self.get_config_file_path(), self.get_config_file_path("minion")
)
salt.features.setup_features(opts)
return opts
class SaltCMDOptionParser(
@ -2362,9 +2353,7 @@ class SaltCMDOptionParser(
self.exit(42, "\nIncomplete options passed.\n\n")
def setup_config(self):
opts = config.client_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return config.client_config(self.get_config_file_path())
class SaltCPOptionParser(
@ -2435,9 +2424,7 @@ class SaltCPOptionParser(
self.config["dest"] = self.args[-1]
def setup_config(self):
opts = config.master_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return config.master_config(self.get_config_file_path())
class SaltKeyOptionParser(
@ -2729,7 +2716,6 @@ class SaltKeyOptionParser(
# Since we're generating the keys, some defaults can be assumed
# or tweaked
keys_config["pki_dir"] = self.options.gen_keys_dir
salt.features.setup_features(keys_config)
return keys_config
def process_rotate_aes_key(self):
@ -2976,7 +2962,6 @@ class SaltCallOptionParser(
opts = config.minion_config(
self.get_config_file_path(), cache_minion_id=True
)
salt.features.setup_features(opts)
return opts
def process_module_dirs(self):
@ -3078,9 +3063,7 @@ class SaltRunOptionParser(
self.config["arg"] = []
def setup_config(self):
opts = config.client_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return config.client_config(self.get_config_file_path())
class SaltSSHOptionParser(
@ -3420,9 +3403,7 @@ class SaltSSHOptionParser(
break
def setup_config(self):
opts = config.master_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return config.master_config(self.get_config_file_path())
class SaltCloudParser(
@ -3483,11 +3464,9 @@ class SaltCloudParser(
def setup_config(self):
try:
opts = config.cloud_config(self.get_config_file_path())
return config.cloud_config(self.get_config_file_path())
except salt.exceptions.SaltCloudConfigError as exc:
self.error(exc)
salt.features.setup_features(opts)
return opts
class SPMParser(
@ -3543,9 +3522,7 @@ class SPMParser(
self.error("Insufficient arguments")
def setup_config(self):
opts = salt.config.spm_config(self.get_config_file_path())
salt.features.setup_features(opts)
return opts
return salt.config.spm_config(self.get_config_file_path())
class SaltAPIParser(
@ -3571,8 +3548,6 @@ class SaltAPIParser(
_default_logging_logfile_ = config.DEFAULT_API_OPTS[_logfile_config_setting_name_]
def setup_config(self):
opts = salt.config.api_config(
return salt.config.api_config(
self.get_config_file_path()
) # pylint: disable=no-member
salt.features.setup_features(opts)
return opts

View file

@ -431,7 +431,7 @@ def setup_macos(
assert ret.returncode == 0, ret
else:
# We are testing the onedir download
onedir_name = f"salt-{salt_release}-onedir-darwin-{arch}.tar.xz"
onedir_name = f"salt-{salt_release}-onedir-macos-{arch}.tar.xz"
if repo_subpath == "minor":
repo_url_base = f"{root_url}/onedir/{repo_subpath}/{salt_release}"
else:

View file

@ -62,6 +62,10 @@ _deb_distro_info = {
"label": "salt_ubuntu2204",
"codename": "jammy",
},
"23.04": {
"label": "salt_ubuntu2304",
"codename": "lunar",
},
},
}

View file

@ -253,24 +253,43 @@ def generate_workflows(ctx: Context):
test_salt_pkg_downloads_needs_slugs.add("build-ci-deps")
build_rpms_listing = []
for distro, releases in (
("amazon", ("2", "2023")),
("redhat", ("7", "8", "9")),
("fedora", ("36", "37", "38")),
("photon", ("3", "4", "5")),
):
for release in releases:
rpm_os_versions: dict[str, list[str]] = {
"amazon": [],
"fedora": [],
"photon": [],
"redhat": [],
}
for slug in sorted(AMIS):
if slug.endswith("-arm64"):
continue
if not slug.startswith(
("amazonlinux", "almalinux", "centos", "fedora", "photonos")
):
continue
os_name, os_version = slug.split("-")
if os_name == "amazonlinux":
rpm_os_versions["amazon"].append(os_version)
elif os_name == "photonos":
rpm_os_versions["photon"].append(os_version)
elif os_name == "fedora":
rpm_os_versions["fedora"].append(os_version)
else:
rpm_os_versions["redhat"].append(os_version)
for distro, releases in sorted(rpm_os_versions.items()):
for release in sorted(set(releases)):
for arch in ("x86_64", "arm64", "aarch64"):
build_rpms_listing.append((distro, release, arch))
build_debs_listing = []
for distro, releases in (
("debian", ("10", "11", "12")),
("ubuntu", ("20.04", "22.04")),
):
for release in releases:
for arch in ("x86_64", "arm64"):
build_debs_listing.append((distro, release, arch))
for slug in sorted(AMIS):
if not slug.startswith(("debian-", "ubuntu-")):
continue
if slug.endswith("-arm64"):
continue
os_name, os_version = slug.split("-")
for arch in ("x86_64", "arm64"):
build_debs_listing.append((os_name, os_version, arch))
env = Environment(
block_start_string="<%",