Open pgsmith123 opened 3 years ago
I see the similar issue as @pgsmith123.
I don't know much about writing Go, but I've seen that a TypeList
is used when the order matters, but a TypeSet
can be used when the order has no impact on behavior. datasource_cloud_account_vmc.go uses a TypeList
and perhaps changing to TypeSet
would suffice, since it appears (to me as a user) that the order shouldn't affect behavior.
If that's correct (and again, I do not know go very well) then perhaps the fix is as simple as replacing L55-61 with
"regions": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
I don't think the tests need updated since the Type is not specified in it.
@rnelson0 You're right, if the order does not matter, we should be using a TypeSet
. I've submitted PR #411 to address this.
But the above PR will not fix all the resources, there are some of them (specifically vra_flavor_profile
and vra_image_profile
) that need some extra work. The challenge here is that there is actually no way of setting a stable identifier for Sets
, so for those objects where vRA adds some extra parameters (like the previously mentioned one), every time you perform an apply
operation, Terraform is going to detect that there is a change (see this discussion for more details). The (ultimate) fix most likely will introduce some breaking changes, so we need to properly evaluate how we are going to introduce them.
@frodenas Awesome, thank you for that PR! I’m looking forward to testing this out soon!
@frodenas FYI We're on 0.5.0+ and no longer seeing this issue. Can't speak for @pgsmith123 of course but maybe this addressed their issue, too.
What about you @VickyWinner?
Ryan Johnson Senior Staff Solutions Architect | Product Engineering @ VMware, Inc.
We are still seeing the issue using the vra_image_profile resource having multiple image_mappings. As far as I can see, the resource was not touched with PR #411.
We use the latest version of the vra_provider 0.5.1 from the hashicorp registry.
I am seeing the issue once again with 0.7.0 from the hashicorp registry for vra_image_profile. I believe that 0.7.0 switched to using image_id where as 0.6.0 was using image_name. I was able to successfully see no changes with 0.6.0 but now see changes each time I run terraform with 0.7.0
I too am still having this problem with the vra_image_profile
resource. We're using 0.8.6 from the HashiCorp registry.
I am using vRA 8.4.1, terraform 1.0.1, and the vRA provider 0.3.8.
I have configured a vSphere cloud account, two zones, and an image mapping with four templates. The initial apply builds all the objects correctly. When running a secondary plan or apply terraform wants to update all the objects even though no changes have been made.
cloud account
zone
image mapping
Running an apply completes successfully and says that it updates the cloud account and the image mappings.
Nothing seems to be updated on the vRA side and everything continues working as expected.
It always wants to update the same items every time an apply or plan is executed.
This is the config for the cloud account and zones