-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce validation with a custom generator
This commit unifies the functionality of `Generator.Generate` and `GenerateWithOptions`, so that they now both call `ProviderInfo.Validate` (previously, only `Generator.Generate` called `ProviderInfo.Validate`). This caused 2 unrelated tests to fail. Both can be fixed by removing the invalid mappings they used to have.
- Loading branch information
Showing
16 changed files
with
799 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pf/tfgen/testdata/TestTypeOverride/attr-list-element.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
pf/tfgen/testdata/TestTypeOverride/attr-list-max-items-one.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1": { | ||
"type": "string" | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1": { | ||
"type": "string" | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
pf/tfgen/testdata/TestTypeOverride/attr-list-nested-object-object.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"types": { | ||
"testprovider:index/ResA1:ResA1": { | ||
"properties": { | ||
"foo": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
}, | ||
"required": [ | ||
"a1" | ||
], | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
pf/tfgen/testdata/TestTypeOverride/attr-map-element.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
pf/tfgen/testdata/TestTypeOverride/attr-map-object-element.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"types": { | ||
"testprovider:index/ResA1:ResA1": { | ||
"properties": { | ||
"n1": { | ||
"type": "number" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
pf/tfgen/testdata/TestTypeOverride/attr-set-element.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1s": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
pf/tfgen/testdata/TestTypeOverride/attr-single-nested-object-element.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "testprovider", | ||
"attribution": "This Pulumi package is based on the [`testprovider` Terraform Provider](https://github.com/terraform-providers/terraform-provider-testprovider).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"config": {}, | ||
"types": { | ||
"testprovider:index/ResA1:ResA1": { | ||
"properties": { | ||
"n1": { | ||
"type": "number" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"provider": {}, | ||
"resources": { | ||
"testprovider:index:Res": { | ||
"properties": { | ||
"a1": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
}, | ||
"inputProperties": { | ||
"a1": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
}, | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering Res resources.\n", | ||
"properties": { | ||
"a1": { | ||
"$ref": "#/types/testprovider:index/ResA1:ResA1" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.