Skip to content

Fix nested template panic #1480

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

Merged

Conversation

mihaitodor
Copy link
Contributor

This is a naive attempt to fix a panic that came up on the #gomplate channel on the Gophers Slack. I'm really not sure if this is the best way to fix the issue, but the changes in TestParseConfigFile will help you reproduce the issue easily. Alternatively, maybe this custom UnmarshalYAML should take the receiver by value rather than by pointer, but I'm not sure if the rest of the custom logic will still work in that case.

@hairyhenderson
Copy link
Owner

Thanks so much for this @mihaitodor!! I'm surprised there wasn't an integration test that caught this - I'll add one of those too.

I'll be glad to get rid of the old (list of strings) syntax, since supporting both formats is a huge pain 😅

@mihaitodor mihaitodor force-pushed the fix-nested-template-panic branch from 134a061 to 81ce441 Compare August 18, 2022 11:55
@hairyhenderson
Copy link
Owner

I've found a simpler way to fix this, right in the UnmarshalYAML function... commit coming in a few minutes...

Copy link
Owner

@hairyhenderson hairyhenderson left a comment

Choose a reason for hiding this comment

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

Thanks again for your help with this @mihaitodor! 🙇‍♂️

@hairyhenderson hairyhenderson enabled auto-merge (squash) August 18, 2022 12:54
@mihaitodor
Copy link
Contributor Author

Nice find @hairyhenderson! I was sure there is a better way to fix this :)

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.

2 participants