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

Rancher_app and rancher_app_v2 configuration drift for structurally equal values.yaml string #871

Open
herrbpl opened this issue Feb 24, 2022 · 3 comments

Comments

@herrbpl
Copy link

herrbpl commented Feb 24, 2022

Rancher app resource uses values or values_yaml input as a string, causing configuration drift on structrually and datawise equal input.

in addition, rancher_app_v2 seems to format input internally and use formatted value to compare with user provided value.

Using yalmencode function output
as resource input always causes drift for me.

Initially thought to solve it to try format input as needed using yamldecode but it does not support output customization options and maintainer rather helpfully provided kind request to take issue up in rancher provider tracker.

hashicorp/terraform#23322

Thanks,
Siim

@lots0logs
Copy link
Contributor

lots0logs commented Feb 25, 2022

I can confirm this problem. When yamlencode() is used as values param for rancher_app_v2 resource, it will always show changed when you run terraform plan even if it hasn't been changed. It appears to be caused by the fact that yamlencode() quotes all the keys and list items.

cc: @snasovich
related: #533

@herrbpl
Copy link
Author

herrbpl commented Jun 3, 2022

In additional notes, it seems to differ between '' and "" and also order of keys in yaml, so clearly comparison function ( https://github.com/rancher/terraform-provider-rancher2/blob/master/rancher2/schema_app_v2.go#L129 ) in use is unsuitable for detecting real diff.
Maybe it would work better if generated structure is converted to json and then back to map[interface] before doing deepEqual ?

@iosifnicolae2
Copy link

Any news 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

No branches or pull requests

3 participants