-
Notifications
You must be signed in to change notification settings - Fork 69
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
generate: pass through correct name of schema provider #148
Conversation
c95720f
to
2570a93
Compare
After updating to 0.9.0, I found that individual template overrides no longer worked using the `generate` command however, would work if using `tfplugindocs` directly. I started looking into why this was and it boiled down to being that the value from `--rendered-provider-name` was being incorrectly passed into `resourceSchema` causing the friendly name (such as `Cloudflare`) to be used instead of the correct schema name (here, `terraform-provider-cloudflare`) resulting in the schema never being found for the data-source or resource. This corrects the value we pass to the render website methods to always be the schema provider, not the friendly name. Closes hashicorp#139
2570a93
to
75cbfe9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that this is the first step: I was looking at this change, and it essentially results in no use of that renderedProviderName
.
But in #149 you kinda close the circle, and it makes sense.
yep! I'm also leaving the default in the template as I don't think we want this as the default anywhere (even with a fallback) just yet. ideally, people can choose to customise it going forward and it will be work but not forced on anyone. |
if err != nil { | ||
return err | ||
} | ||
|
||
g.infof("rendering static website") | ||
err = g.renderStaticWebsite(g.renderedProviderName, providerSchema) | ||
err = g.renderStaticWebsite(providerName, providerSchema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this line shouldn't have change??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scratch that.. Doesn't seem to make a difference.
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. |
After updating to 0.9.0, I found that individual template overrides no
longer worked using the
generate
command however, would work if usingtfplugindocs
directly. I started looking into why this was and itboiled down to being that the value from
--rendered-provider-name
wasbeing incorrectly passed into
resourceSchema
causing the friendly name(such as
Cloudflare
) to be used instead of the correct schema name(here,
terraform-provider-cloudflare
) resulting in the schema neverbeing found for the data-source or resource. This corrects the value we
pass to the render website methods to always be the schema provider, not
the friendly name.
Closes #139