Skip to content

Widen VALID_OPTS to allow None for cluster_pki_dir / cluster_secret / cluster_pub_fingerprint - #70722

Closed
dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/backport/3008.x-opts-type
Closed

dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/backport/3008.x-opts-type

Conversation

@dwoz

@dwoz dwoz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Found during a doc-correctness audit of the master-topology work.

salt/config/__init__.py declares three cluster opts as bare str in VALID_OPTS but defaults all three to None in DEFAULT_MASTER_OPTS. Every reader already treats None and "" identically (opts.get(...) truthy checks, (x or "") guards), so the mismatch is cosmetic — but _validate_opts logs a warning for each at master startup because isinstance(None, str) is False.

Fix: widen the three entries to (type(None), str). Matches the real default, preserves str as the valid user-set value, and silences the startup noise.

Test plan

  • pytest tests/pytests/unit/config/ — 171 passed, 2 skipped
  • Independent audit confirmed no caller distinguishes None from "" and no test pins the current (bare str) declaration

`cluster_pki_dir`, `cluster_secret`, and `cluster_pub_fingerprint` are
declared as `str` in VALID_OPTS but default to `None` in
DEFAULT_MASTER_OPTS. Widen each to `(type(None), str)` so the declared
type matches the real default and strict-type validators stop flagging
the mismatch. User-set string values remain valid.
@dwoz
dwoz requested a review from a team as a code owner November 7, 2026 05:31
@dwoz dwoz added the test:full Run the full test suite label Nov 7, 2026
@dwoz dwoz added this to the Argon v3008.7 milestone Nov 7, 2026
@dwoz dwoz mentioned this pull request Nov 9, 2026
3 tasks done
@dwoz

dwoz commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #70755 which combines all five cluster-correctness backports into a single PR.

@dwoz dwoz closed this Nov 9, 2026

This branch was previously deployed

1 inactive deployment
ci — b7c0e56a Deployed Nov 7, 2026 by dwoz via Build Onedir Packages / DEB (x86_64) #28603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant