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 initial_filesystem_type and initial_filesystem_label when reading volume resource #990

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohsenSy
Copy link
Contributor

@mohsenSy mohsenSy commented May 3, 2023

closes #984

Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

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

Hi @mohsenSy, thanks for looking into this one. Unfortunately, it is a bit more complicated that this.

initial_filesystem_type and initial_filesystem_label are create time options that should not be set on read. They mean different things than filesystem_type and filesystem_label which are computed attributes that can change (e.g. the user re-formats the volume manually). There is some context in #136. We also need to support creating un-formatted volumes. As the API reports the current file system type, this would cause Terraform to try to recreate the volume once formatted.

We could potentially create a custom import function that sets them on import. Though that would effectively make them required on import. It would take some testing, by maybe a DiffSuppressFunc could work here? 🤔

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.

After importing digitalocean_volume to TF state, initial_filesystem_* attributes triggers recreation
3 participants