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

Prevent an endless diff loop for deployments with no trust defined #687

Merged
merged 5 commits into from
Aug 16, 2023

Conversation

tobio
Copy link
Member

@tobio tobio commented Aug 13, 2023

Description

Does what it says on the tin. I can't create a deployment in this state, however I've tested the code against the response body of the deployment mentioned in the linked issue.

Null state values are ignored by UseStateForUnknown, which leads to endless diff loops when trust settings are nil.

Related Issues

Fixes #686

Motivation and Context

How Has This Been Tested?

Unit tests, manually

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

@tobio tobio requested a review from dimuon August 13, 2023 10:36
@tobio tobio self-assigned this Aug 13, 2023
@tobio tobio requested a review from a team as a code owner August 13, 2023 10:36
@tobio
Copy link
Member Author

tobio commented Aug 13, 2023

Acceptance test failure appears unrelated.

@wandergeek
Copy link
Collaborator

wandergeek commented Aug 15, 2023

~/work/terraform-provider-ec pr/687                                                                                                                                                                     ✘ INT  base
❯ make check-license
-> Running license check...
ec/ecresource/deploymentresource/elasticsearch/v2/elasticsearch_trust_account_test.go: is missing the license header
ec/ecresource/deploymentresource/elasticsearch/v2/elasticsearch_trust_external_test.go: is missing the license header
make: *** [build/Makefile.lint:19: check-license] Error 1

Missing license header. LGTM otherwise.

@tobio tobio merged commit a031168 into elastic:master Aug 16, 2023
@tobio tobio deleted the support-suspicious-deployments branch August 16, 2023 05:35
tobio added a commit to tobio/terraform-provider-ec that referenced this pull request Aug 20, 2023
…pdates

* upstream/master:
  Update documentation, CHANGELOG.md, and NOTICE
  Prevent an endless diff loop for deployments with no trust defined (elastic#687)
  Update documentation, CHANGELOG.md, and NOTICE
  Set the deployment id in state as soon as it's available to avoid unmanaged resources (elastic#690)
  Update documentation, CHANGELOG.md, and NOTICE
  Deployment data source should treat stopped deployments consistently to the deployment resource.  (elastic#688)
  Update documentation, CHANGELOG.md, and NOTICE
  Update golang.org/x/exp digest to 89c5cff (elastic#685)
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.

trust_account and trust_external always drifting
3 participants