Skip to content

Commit

Permalink
generate: pass through correct name of schema provider
Browse files Browse the repository at this point in the history
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 #139
  • Loading branch information
jacobbednarz committed Jun 13, 2022
1 parent cbd432b commit c95720f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/generate.go
Expand Up @@ -170,13 +170,13 @@ func (g *generator) Generate(ctx context.Context) error {
}

g.infof("rendering missing docs")
err = g.renderMissingDocs(g.renderedProviderName, providerSchema)
err = g.renderMissingDocs(providerName, providerSchema)
if err != nil {
return err
}

g.infof("rendering static website")
err = g.renderStaticWebsite(g.renderedProviderName, providerSchema)
err = g.renderStaticWebsite(providerName, providerSchema)
if err != nil {
return err
}
Expand Down

0 comments on commit c95720f

Please sign in to comment.