Skip to content

Refresh pillar cache when saltutil.refresh_pillar is run#60975

Merged
Ch3LL merged 3 commits intosaltstack:masterfrom
Ch3LL:pillar_cache
Oct 8, 2021
Merged

Refresh pillar cache when saltutil.refresh_pillar is run#60975
Ch3LL merged 3 commits intosaltstack:masterfrom
Ch3LL:pillar_cache

Conversation

@Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented Sep 29, 2021

What does this PR do?

When a user has pillar_cache set to True, the cache will not be refreshed when running salt \* saltutil.refresh_pillar. This PR adds the ability for the cache to be udpated when this is run. This PR still ensures when running a state or pillar.items for example it will not update the cache. When a user is running saltutil.refresh_pillar this would be intentional and would expect the cache to be updated.

What issues does this PR fix or reference?

Fixes: #60897

Previous Behavior

salt \* saltutil.refresh_pillar would not update the pillar cache.

New Behavior

refresh_pillar no updates the pillar cache.

Merge requirements satisfied?

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

@Ch3LL Ch3LL requested a review from a team as a code owner September 29, 2021 17:50
@Ch3LL Ch3LL requested review from krionbsd and removed request for a team September 29, 2021 17:50
Copy link
Contributor

@terminalmage terminalmage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple docs nitpicks and one question.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "affects" here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/your/you/

Also, probably don't need to say "to be True", "to True" is probably OK.

salt/minion.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force_refresh is passed through elsewhere, should it really be hardcoded here rather than passing it through?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point, I will make it configurable, so the user can choose not to refresh the pillar cache. I also think I am going to rename force_refresh, since this is a kwarg already used in saltutil.refresh_pillar used for refreshing modules.

@Ch3LL Ch3LL added the Phosphorus v3005.0 Release code name and version label Oct 1, 2021
@Ch3LL Ch3LL force-pushed the pillar_cache branch 2 times, most recently from 22ac03f to 681d2cc Compare October 6, 2021 14:56
@Ch3LL Ch3LL changed the title [WIP] Refresh pillar cache when saltutil.refresh_pillar is run Refresh pillar cache when saltutil.refresh_pillar is run Oct 6, 2021
@Ch3LL
Copy link
Contributor Author

Ch3LL commented Oct 6, 2021

@terminalmage ready for re-review

Copy link
Contributor

@terminalmage terminalmage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@waynew waynew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good. Checked tests against the current salt/main pillar and they just got stuck, and they pass with the current code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Phosphorus v3005.0 Release code name and version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Pillar Cache can't be updated or invalidated

3 participants