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

[3006.x] Allow synced modules to override salt extensions #65938

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

max-arnold
Copy link
Contributor

@max-arnold max-arnold commented Jan 28, 2024

What does this PR do?

Swap (3) and (4) in the module search path order, see the Previous Behavior below

Previous Behavior

Current module search path:

  1. CLI arg --module-dirs to salt-call
  2. Config option TYPE_dirs
  3. Setuptools entrypoints
  4. Module cache dir (saltutil syncs here)
  5. Builtin modules

It doesn't allow a user to override a module that was migrated to extension.

New Behavior

The new priorities and their use-cases:

  1. Cli arg is useful for quick development iterations and one-off commands
  2. Config option is the same, but set permanently in the master or minion config. Very useful to keep modules between salt upgrades and cache cleans
  3. Cache dir is for syncable modules (easy to keep custom mods in the state tree)
  4. Entrypoints are for 3rd party extensions
  5. Builtin are for core

This follows a logical progression from a more user-controlled to less user-controlled. And allows user-supplied overrides/extends for each level.

If a user has a custom module in _modules that overrides/extends a core module, and the core module was migrated to an extension, the user-supplied override will still work.

Merge requirements satisfied?

Commits signed with GPG?

No

@nicholasmhughes
Copy link
Collaborator

Core Team, what's the likelihood of allowing a port over to the 3007.x branch so folks can start taking advantage of this sooner?

@max-arnold
Copy link
Contributor Author

Yeah, it is a good idea to merge this in 3007.x, because the extension migration process is already underway and it might break user-supplied overrides

@s0undt3ch s0undt3ch self-assigned this Jan 31, 2024
@s0undt3ch
Copy link
Collaborator

Doc build failures are unrelated and getting fixed on separate PRs. Merging.

@s0undt3ch s0undt3ch merged commit a14e899 into saltstack:3006.x Jan 31, 2024
981 of 989 checks passed
@max-arnold
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:3006.x Backport PR to 3006.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants