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

Bugfix: Only pass snapshot settings into the update plan if there are changes #858

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

gigerdo
Copy link
Member

@gigerdo gigerdo commented Sep 20, 2024

  • This ensures the settings are only put into the update request if there are actual changes in the config
  • Otherwise the settings are left out of the payload
  • This solves a bug where every apply would reset the policy back to the default (because putting the default settings in the plan will cause it to reset the policy).
    • When using the elasticstack provider to manage the policy, we want the ec provider to not touch it.

Related Issues

#854

Motivation and Context

How Has This Been Tested?

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

… changes.

- This ensures the settings are only put into the update request if there are actual changes in the config
- Otherwise the settings are left out of the payload
- This solves a bug where every apply would reset the policy back to the default (because putting the default settings in the plan will cause it to reset the policy).
  - When using the elasticstack provider to manage the policy, we want the ec provider to not touch it.
@gigerdo gigerdo force-pushed the fix-snapshot-policy-reset-but branch from 0517893 to 627c5b1 Compare September 20, 2024 13:12
@gigerdo gigerdo marked this pull request as ready for review September 20, 2024 13:17
@gigerdo gigerdo requested a review from a team as a code owner September 20, 2024 13:17
Copy link

@nick-benoit nick-benoit left a comment

Choose a reason for hiding this comment

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

👍 Nice work. Nice tests as well!

Copy link

@nick-benoit nick-benoit left a comment

Choose a reason for hiding this comment

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

LGTM

@gigerdo gigerdo merged commit 98dfc06 into elastic:master Sep 23, 2024
3 checks passed
@gigerdo gigerdo deleted the fix-snapshot-policy-reset-but branch September 23, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants