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

Handle unknown values in deployment snapshot repository references #666

Merged
merged 3 commits into from
Jun 17, 2023

Conversation

tobio
Copy link
Member

@tobio tobio commented Jun 15, 2023

Description

Previously, the code was setting repository.reference: null in state for ESS deployments. This means that UseStateForUnknown does not actually set the planned value, leaving it as unknown. When TF comes back to parse this into the ElasticsearchSnapshotRepositoryReference struct it can't and the whole thing falls apart.

This PR updates the code to only set the repository reference value if it exists. In reality this just moves the problem up one level to the repository field, but we introduce a TF type where the repository support unknowns via types.Object, updating the consuming code accordingly.

Related Issues

Fixes #665

Motivation and Context

How Has This Been Tested?

Manually, I don't understand why this wasn't failing the existing acceptance tests. I'm clearly missing something, as I would have expected any updates to hit this error (that's my manual repro).

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 June 15, 2023 11:54
@tobio tobio requested a review from a team as a code owner June 15, 2023 11:54
@tobio tobio self-assigned this Jun 15, 2023
@tobio tobio merged commit 81ee607 into elastic:master Jun 17, 2023
@tobio tobio deleted the handle-unknown-snapshot-repos branch June 17, 2023 11:42
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.

Target Type: *v2.ElasticsearchSnapshotRepositoryReference
2 participants