Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

[WIP] Suppress diff forconfiguration items in case they are not set#66

Open
marratj wants to merge3 commits intovmware-archive:main
base:main
Choose a base branch
Loading
fromgfkse:marratj-suppress-diff-for-resource-configuration

Conversation

marratj
Copy link

@marratjmarratj commentedApr 30, 2020
edited
Loading

When there is a Deployment with resource configurations for VMs that contain more or different custom properties within theconfiguration map, each time whenterraform plan is run, there is a diff produced that completely removes theconfiguration block withinresource_configuration and adds a new one with only the values provided in thevra7_deployment TF resource.

This seems to be becauseresource_configuration is aTypeSet in the Resource Schema.

That means, each time the hash calculated from the settings in the state is not identical to the one in the resource config, Terraform treats it as a differentresource_configuration and wants to remove the existing block from the state and put in only the values in the config.

For this, I propose to change this toTypeList. However, this would depend on the vRA7 API returning thecontent[] in theResourceView response always in the same order (which I'm not 100 % sure of right now).

After changing the Type to List, we also add aDiffSuppressFunc to theconfiguration Element that checks if a custom property from the state needs to be included in the diff.

If it set in the state, but NOT in the resource config, we ignore the diff. This is because often there are quite a lot of custom properties returned for a VM that are set on vRA side and are not of interest to the resource configuration in the first place.

Aims tofix#56

mcascone and marratj reacted with eyes emoji
@ghostghost added the size/XS labelApr 30, 2020
@marratjmarratj changed the titleSuppress diff forconfiguration items in case they are not set[WIP] Suppress diff forconfiguration items in case they are not setApr 30, 2020
@marratj
Copy link
Author

One thing I currently have in theDiffSuppressFunc is that it will ignore any custom properties from vRA/the state file that are not explicitly set in theresource_configuration.

However, that would mean for certain configurations where one would want to intentionally change a custom property from a set value to an empty value that this would also not produce a diff and therefore not trigger a change.

Any ideas on how to handle those cases?

@marratj
Copy link
Author

@Prativa20 any thoughts on this?

Signed-off-by: Marcel Juhnke <marcel.juhnke@gfk.com>
@marratjmarratjforce-pushed themarratj-suppress-diff-for-resource-configuration branch fromebe9ec2 tocedb1feCompareMay 8, 2020 13:28
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

terraform apply always results in change despite not change to .tf

1 participant

@marratj

[8]ページ先頭

©2009-2025 Movatter.jp