Skip to content

Commit

Permalink
Do not wipe the version when generating schemas for dynamic providers (
Browse files Browse the repository at this point in the history
…#2727)

#2664 introduced using the full Generator for schema gen. 
This added a call to UnstableGenerateFromSchema, which removes the
version field from the package spec, a feature intended to make local
builds stable.
This pull request re-adds the version in `SchemaPostProcessor`.
  • Loading branch information
guineveresaenger authored Dec 12, 2024
2 parents 7b3ace6 + c808b54 commit 1433ab4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dynamic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func initialSetup() (info.Provider, pfbridge.ProviderMetadata, func() error) {
if err != nil {
return nil, err
}
packageSchema.PackageSpec.Version = info.Version

if info.SchemaPostProcessor != nil {
info.SchemaPostProcessor(&packageSchema.PackageSpec)
Expand Down Expand Up @@ -131,7 +132,6 @@ func initialSetup() (info.Provider, pfbridge.ProviderMetadata, func() error) {
if err != nil {
return plugin.ParameterizeResponse{}, err
}

v, err := semver.Parse(p.Version())
if err != nil {
return plugin.ParameterizeResponse{}, err
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "b2",
"version": "0.8.9",
"description": "A Pulumi provider dynamically bridged from b2.",
"attribution": "This Pulumi package is based on the [`b2` Terraform Provider](https://github.com/backblaze/terraform-provider-b2).",
"repository": "https://github.com/backblaze/terraform-provider-b2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "databricks",
"version": "1.50.0",
"description": "A Pulumi provider dynamically bridged from databricks.",
"attribution": "This Pulumi package is based on the [`databricks` Terraform Provider](https://github.com/databricks/terraform-provider-databricks).",
"repository": "https://github.com/databricks/terraform-provider-databricks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "random",
"version": "3.3.0",
"description": "A Pulumi provider dynamically bridged from random.",
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/hashicorp/terraform-provider-random).",
"repository": "https://github.com/hashicorp/terraform-provider-random",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "terraform-provider",
"displayName": "Any Terraform Provider",
"version": "v0.0.0-dev",
"description": "Use any Terraform provider with Pulumi",
"keywords": [
"category/utility"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "random",
"version": "3.6.3",
"description": "A Pulumi provider dynamically bridged from random.",
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/hashicorp/terraform-provider-random).",
"repository": "https://github.com/hashicorp/terraform-provider-random",
Expand Down

0 comments on commit 1433ab4

Please sign in to comment.