terraform-provider-docker
terraform-provider-docker copied to clipboard
Using devices always force replacement (it should not)
In a shell:
+ devices { # forces replacement
+ host_path = "/dev/snd"
}
- devices { # forces replacement
- container_path = "/dev/snd" -> null
- host_path = "/dev/snd" -> null
- permissions = "rwm" -> null
}
@suzuki-shunsuke @mavogel
I tried to fix this using DiffSuppressFunc, Default (https://www.terraform.io/docs/extend/schemas/schema-behaviors.html) but couldn't figure out a way (not sure why it's not working as other cases like working_dir).
Any pointer on how to approach this?
Desired behavior:
Permissions:
- if permissions is empty or not set, it should be treated as if set to "rwm"
- if permissions is set, it should be any combination of "r", "w", "m" (not repeated, case-sensitive), otherwise it's invalid
- it should then be compared with the value in the running container, with the letters sorted to avoid rebuilding when the value is the same with a different order
ContainerPath:
- if not set, it should be treated as if set to the value of host_path
TBH I'm in general not happy with all the usage of DiffSuppressFunc
and I think I need a feedback round with HC folks to understand how to implement those cases correctly
This issue is stale because it has been open 60 days with no activity.
Remove stale
label or comment or this will be closed in 7 days.
If you don't want this issue to be closed, please set the label pinned
.
Still an issue - should be reopened.
This issue is stale because it has been open 60 days with no activity.
Remove stale
label or comment or this will be closed in 7 days.
If you don't want this issue to be closed, please set the label pinned
.
Still an issue, bot ;-).