Skip to content

Set initial_filesystem_type and initial_filesystem_label when reading volume resource#990

Open
mohsenSy wants to merge 1 commit intodigitalocean:mainfrom
mohsenSy:set-initial-file-system-label-when-reading-volume
Open

Set initial_filesystem_type and initial_filesystem_label when reading volume resource#990
mohsenSy wants to merge 1 commit intodigitalocean:mainfrom
mohsenSy:set-initial-file-system-label-when-reading-volume

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