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] fix(saltclass): don't lose nested classes and states in recursion #66918

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

baby-gnu
Copy link
Contributor

@baby-gnu baby-gnu commented Sep 23, 2024

What does this PR do?

This PR keep all the classes and states from recursive expansion of saltclass classes.

What issues does this PR fix or reference?

Fixes #58969
Fixes #63933

Previous Behavior

Only states from top level classes were kept.

New Behavior

All states from all classes are used, in the correct order.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices, including the
PR Guidelines.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@baby-gnu baby-gnu requested a review from a team as a code owner September 23, 2024 20:05
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title fix(saltclass): don't loose nested classes and states in recursion [3006.x] fix(saltclass): don't loose nested classes and states in recursion Sep 23, 2024
@twangboy
Copy link
Contributor

We'll need a changelog and some tests for this.

@baby-gnu
Copy link
Contributor Author

We'll need a changelog and some tests for this.

Ok, the changelog is quite easy, I'll need to document for testing.

twangboy
twangboy previously approved these changes Sep 26, 2024
twangboy
twangboy previously approved these changes Sep 30, 2024
@baby-gnu
Copy link
Contributor Author

Thanks @twangboy, should I rebase the branch over 3006.x from time to time until it get merge?

A pillars dict in a minion node definition was not overridding
correctly the same dict in classes.

* salt/utils/saltclass.py (expanded_dict_from_minion): do not pass a
  reference to minion dict or it will be overridden by classes during
  expansion.

Fixes: saltstack#63933
@baby-gnu
Copy link
Contributor Author

Thanks @twangboy, should I rebase the branch over 3006.x from time to time until it get merge?

I reword my commit message to fix typo as you did in the title 👍

@dwoz dwoz added the test:full Run the full test suite label Oct 17, 2024
@dwoz dwoz merged commit 6e4f178 into saltstack:3006.x Oct 21, 2024
452 checks passed
@baby-gnu baby-gnu deleted the fix/saltclass-nested-states branch October 22, 2024 08:48
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.

3 participants