improvement: Bump Salt to 3006.24#4898
improvement: Bump Salt to 3006.24#4898TeddyAndrieux wants to merge 44 commits intodevelopment/133.0from
Conversation
Hello teddyandrieux,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
b8b4c73 to
cc0d369
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
0ae2995 to
0cc092e
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
0cc092e to
d401278
Compare
…changes` Both as the same effect but `module.wait` + `watch` does not seems to works well with newer salt version
During the bootstrap process, we skip the creation of the salt-master kubeconfig during the highstate since at this stage the kube-apiserver is not ready yet.
During upgrade and downgrade, we patch the kube-system namespace annotation with the new cluster version. Before we were using `state.orchestrate_single` but this one always return an error about `weakly-referenced object no longer exists`, to avoid this we switch to use `state.orchestrate` instead.
Notables changes: - Switch from scality saltstack repository to official saltstack repository - Use classic `six` instead of the removed `salt.ext.six` - We no longer use `ipaddress` from `salt._compat` as since salt 3003 he do not have the same behavior as `ipaddress` from Python3 and we want to keep this behavior - Mount salt cache directory in salt-api container - Rework salt-master image to install python dependencies in salt onedir - Salt `random.get_str` now add punctuation by default (disable it) - Enable x509_v2 features in salt-master and salt-minion (otherwise we need to install m2crypto in the python salt onedir) NOTE: In some place we have to add if blocks to support older salt versions to support upgrade NOTE: We also have to retrieve the old SKI to avoid CA changes when upgrading - Add `-f` flag to pgrep command in salt-master manifest since without it with the new salt python one dir the command is too long and `pgrep salt-master` will not work - Starting salt 3006 salt-api is disabled by default, we enable it - Switch to python39 during expansion since salt-ssh does not support python <= 3.7, we also move to ssh_preflight script
It's the default behavior since salt 3005.
This rpm is not longer needed with the new salt version relying on onedir
This rpm is not longer needed with the new salt version relying on onedir
This rpm is not longer needed with the new salt version relying on onedir
This workaround is not longer needed with the new salt version that support Rocky Linux by default.
We also fix some new pylint warnings, and regenerate fresh pylintrc files
We also fix some new mypy warnings, and add a mypy configuration file
…commit We also remove the platform-requirements.txt file, as it is no longer needed.
Also bump dependencies versions
We also fix tests and tox configuration to works with newer dependencies. Plus we force color in CI runs
We also remove the deprecated assertDictContainsSubset call.
This one was needed to build containerd rpm but we no longer build it ourselves.
salt-ssh's `SSH.__init__` calls `_expand_target`, which when given a single non-glob target that resolves to a reachable host calls `_get_roster` -> `salt.roster.get_roster_file`. That helper requires the configured roster file (default `/etc/salt/roster`) to exist on disk and be readable, even when a non-flat backend like `kubernetes` is selected via `roster: kubernetes` - the file is only stat'd, never read. When no roster file is present, `salt-ssh --roster=kubernetes <single-host> ...` fails with `OSError: Roster file "/etc/salt/roster" not found`. Most invocations don't trip this because they use a glob (`salt-ssh '*' ...`) or target an unreachable host - both bypass the expansion path that hits `_get_roster`. Drop a zero-byte `/etc/salt/roster` into the salt config so the check passes regardless of how operators invoke salt-ssh against the cluster.
NOTE: Due to a bug in salt 3006.24, we need to patch the salt code to fix salt-ssh compatibility with Python 3.12.
d401278 to
486d1a9
Compare
Salt 3006.24 upgrade
m2cryptopackage and them2cryptoSalt state — Salt 3006 shipscryptography-backedx509_v2, enabled viafeatures: { x509_v2: true }on master and minion configsverboseparameter fromx509module callsuse_supersededonmodule.runstatesmodule.wait+watchpattern withmodule.run+onchangesmodule.runSalt state where it has no remaining purposeSalt master/minion compatibility during upgrade
minimum_auth_version: 2on the master to accept v2-protocol minions during the rolling upgrade (to be removed in development/135)reload_modules: Falseoverride on the salt-minion package install to skip the post-installmodule_refreshthat fails when the running 3002 minion's files are replaced by the onedir layoutssh_pre_flightscript (ssh-preflight.sh) that installspython3.12and switches thepython3alternative on each target — Salt 3006 thin requires Python >= 3.7, RHEL/Rocky 8 ships 3.6python3.12and set thepython3alternativednfto the salt-master image so theyumpkgSalt module loads (its__virtual__rejectsmicrodnf-only environments and would otherwise disablepkg.*includingpkg.version_cmp)Certificate authority handling (upgrade path from old
x509/m2crypto-generated certs)preserved_skiJinja macro that pinssubjectKeyIdentifieronx509.certificate_managedto the value of the existing CA cert (orhashon first install) — preventsx509_v2from regenerating CAs with a new SKI that would invalidate every leaf cert's AKI, sincecryptographyandm2cryptocompute the SKI differently for the same public key. Critical when upgrading clusters whose CAs were originally generated by the oldx509(m2crypto) module.Salt orchestration fixes
state.orchestrate_singlewithstate.orchestrate+ a dedicatedpatch_kubesystem_namespace.sls— the_singlerunner has long tripped aReferenceError: weakly-referenced object no longer existson the post-state event firing, but in 3006 it now propagates as a non-zero exit code (was previously swallowed silently)require_inindeploy_nodeorchestratePython and OS toolchain
python36-rpm,python36-pyOpenSSL,python36-psutilpackage dependencieslib-alert-treeto Python 3.10virtualenv < 20.22.0pin in tox.ini (was needed for Python 3.6)Build / CI / lint
cloudpickleand uses stdlibpickle, which rejects local closures — refactoron_failureandtitle_*helpers inbuildchain/buildchain/iso.pyandbuildchain/buildchain/utils.pyto module-level functions (usingfunctools.partialwhere they capture an argument)git config --globaltogit config --systemindocs/entrypoint.shso the tempuser the build sudo's to inherits thesafe.directorysetting andgit describeno longer fails (which had silently setrelease = Noneand broken Sphinx)pip-compileinvocations fromtox.inito pre-commit hooksPatch
Fixes: #3436 MK8S-251
TODO:
development/134.0once available