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

Data Factory - Global Parameters, bug fix while reading editted or existing global parameter values #13519

Merged
merged 7 commits into from Oct 25, 2021

Conversation

andy-mcgrath
Copy link
Contributor

@andy-mcgrath andy-mcgrath commented Sep 27, 2021

resourceDataFactoryRead, flattenDataFactoryGlobalParameters set to convert Array and Object types to JSON encoded string


This is due to the type returned by the API can be the declared type or a string. This change converts the actual global parameter values to a string to compare with the state.

This removes the following error

Error: setting `global_parameter`: global_parameter.0.value: '' expected type 'string', got unconvertible type 'float64'

Resolves #12301

@andy-mcgrath andy-mcgrath changed the title Data Factory - Global Parameters, bug fix while reading editted or existing parameters Data Factory - Global Parameters, bug fix while reading editted or existing global parameter values Sep 27, 2021
@andy-mcgrath andy-mcgrath marked this pull request as ready for review September 27, 2021 13:34
@andy-mcgrath
Copy link
Contributor Author

Found with these changes if jsonencode() is used for the vales when the type is Array or Object changes outside of Terraform (without changing the actual values) do not force an update.

I have added a Note to the docs recommending the use of jsonencode and updated the acceptance tests to use jsonencode() for Array and Object type global parameters.

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andy-mcgrath, looks good, just one query about the casing

internal/services/datafactory/data_factory_resource.go Outdated Show resolved Hide resolved
Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @andy-mcgrath! LGTM now 😄

@catriona-m catriona-m merged commit b79ac39 into hashicorp:main Oct 25, 2021
catriona-m added a commit that referenced this pull request Oct 25, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error related to global_parameter for azurerm_data_factory resource, post provider upgrade to v2.64.0
3 participants