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

Set fields when importing csi volume registrations #402

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

gastrodon
Copy link
Contributor

Create resourceCSIVolumeRegistrationImport, and set some of the fields that terraform otherwise wants to re-create the registration over

Related to #390

lgfa29 added a commit that referenced this pull request Dec 15, 2023
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @gastrodon!

Your analysis was spot on, but the fix was actually a little simpler. The missing attributes were actually missing from resourceCSIVolumeRead, which is what the passthrough importer uses.

I pushed a commit with this approach and also added a changelog entry.

Thanks again for the contribution!

@lgfa29
Copy link
Contributor

lgfa29 commented Dec 15, 2023

Oops...I forgot resourceCSIVolumeRead is shared between volume and volume registration so we can't set the external_id there 😅

I will push a commit to fix it tomorrow.

gastrodon and others added 4 commits December 15, 2023 12:25
Create resourceCSIVolumeRegistrationImport, and set some of the fields
that plan otherwises proposes require replacing
Some volume attributes were not being set on read, resulting in
incorrect import results.
The `resourceCSIVolumeRead` method was shared between `nomad_csi_volume`
and `nomad_csi_volume_registration`, but the `external_id` attribute is
only available for `nomad_csi_volume_registration`, so the method needs
to be split.
@lgfa29 lgfa29 merged commit 7c65c18 into hashicorp:main Dec 15, 2023
1 check passed
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.

None yet

2 participants