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

Fix feature_gates #39

Merged
merged 4 commits into from
May 18, 2023
Merged

Fix feature_gates #39

merged 4 commits into from
May 18, 2023

Conversation

nicokratky
Copy link

Hi!

feature_gates and runtime_config are still broken.

The feature_gates map also had the same problem with the expected type as the runtime_config had. I also had to initialize the RuntimeConfig and FeatureGates maps of the kind resource, as otherwise go would complain about an assignment to an entry in a nil map.
The test cases were also wrong, as you changed the types of those two options to maps.

Feel free to edit/ask for any changes 😊

runtime_config and feature_gates were changed to maps, therefore the
test cases also have to be changed to use the right syntax
@tehcyx tehcyx self-requested a review May 18, 2023 14:21
@tehcyx
Copy link
Owner

tehcyx commented May 18, 2023

Great work, thanks. I had thought I covered it all. Running my tests again. And seems I also have to do some more fixes on PR tester...

@tehcyx
Copy link
Owner

tehcyx commented May 18, 2023

Huh, I was not aware the test syntax is different for the map. TIL!

Btw if you have a suggestion to improve this part: https://github.com/tehcyx/terraform-provider-kind/blob/master/kind/structure_kind_config.go#LL47C16-L47C26

I'm not sure this is the best solution. I was hoping that with a map I could have a "api/alpha" key that is a string, but it seems HCL does not allow that.

@tehcyx
Copy link
Owner

tehcyx commented May 18, 2023

Ran your code locally and it seems to be working fine. I also fixed the PR test runner (again) for the next PR to come in.

@tehcyx tehcyx merged commit 22b2cc4 into tehcyx:master May 18, 2023
@nicokratky
Copy link
Author

Hey! Thanks for merging this so quickly!

Btw if you have a suggestion to improve this part: https://github.com/tehcyx/terraform-provider-kind/blob/master/kind/structure_kind_config.go#LL47C16-L47C26

I think that your solution is actually quite okay, that's a pretty unfortunate limitation of HCL in this case. My only recommendation would be to document this behavior, as it is not trivial that your provider will replace certain characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants