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

decode: do not modify the source data in HookTranslateKeys #8106

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Jun 15, 2020

This was causing a 'fatal error: concurrent map iteration and map write' with gateways.

CC @freddygv , @adilyse I believe you two have more context

This was a problem with the old lib.TranslateKeys as well. I kept the old behaviour in #7963, but this approach (of copying the source before making modifications) seems safer, and is more consistent with mapstructure and other hooks.

@dnephin dnephin force-pushed the dnephin/hook-translate-keys-make-a-copy branch from 3987db0 to b6fa9b3 Compare June 15, 2020 17:56
lib/decode/decode.go Outdated Show resolved Hide resolved
lib/decode/decode.go Outdated Show resolved Hide resolved
This was causing a 'fatal error: concurrent map iteration and map write' with gateways
@dnephin dnephin force-pushed the dnephin/hook-translate-keys-make-a-copy branch from b6fa9b3 to d11674d Compare June 15, 2020 18:22
@preetapan preetapan added this to the 1.8.0 milestone Jun 15, 2020
@dnephin dnephin merged commit ac6c8e5 into master Jun 15, 2020
@dnephin dnephin deleted the dnephin/hook-translate-keys-make-a-copy branch June 15, 2020 18:48
hashicorp-ci pushed a commit that referenced this pull request Jun 15, 2020
…ake-a-copy

decode: do not modify the source data in HookTranslateKeys
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

Successfully merging this pull request may close these issues.

3 participants