diff --git a/changelog/pending/20221208--programgen--interpret-schema-asset-as-pcl-assetorarchive.yaml b/changelog/pending/20221208--programgen--interpret-schema-asset-as-pcl-assetorarchive.yaml new file mode 100644 index 000000000000..15e4e15c697d --- /dev/null +++ b/changelog/pending/20221208--programgen--interpret-schema-asset-as-pcl-assetorarchive.yaml @@ -0,0 +1,4 @@ +changes: +- type: fix + scope: programgen + description: Interpret schema.Asset as pcl.AssetOrArchive. diff --git a/pkg/codegen/pcl/binder_schema.go b/pkg/codegen/pcl/binder_schema.go index 5c88a4e01eda..8ed904939bd1 100644 --- a/pkg/codegen/pcl/binder_schema.go +++ b/pkg/codegen/pcl/binder_schema.go @@ -389,7 +389,11 @@ func (b *binder) schemaTypeToType(src schema.Type) model.Type { case schema.ArchiveType: return ArchiveType case schema.AssetType: - return AssetType + // Generated SDK code accepts assets or archives when schema.AssetType is + // specified. In an effort to keep PCL type checking in sync with our + // generated SDKs, we match the SDKs behavior when translating schema types to + // PCL types. + return AssetOrArchiveType case schema.JSONType: fallthrough case schema.AnyType: diff --git a/pkg/codegen/testing/test/program_driver.go b/pkg/codegen/testing/test/program_driver.go index 28356c74114c..e97a64e8374d 100644 --- a/pkg/codegen/testing/test/program_driver.go +++ b/pkg/codegen/testing/test/program_driver.go @@ -249,7 +249,6 @@ var PulumiPulumiYAMLProgramTests = []ProgramTest{ Directory: transpiled("azure-app-service"), Description: "Azure App Service", Skip: codegen.NewStringSet("go", "dotnet"), - BindOptions: []pcl.BindOption{pcl.SkipResourceTypechecking}, }, { Directory: transpiled("azure-container-apps"),