Skip to content

Commit

Permalink
Merge pull request #324 from pulumi/friel/components-lack-ids
Browse files Browse the repository at this point in the history
fix: Type checker inaccurately allows using 'id' property of a component resource
  • Loading branch information
AaronFriel committed Aug 29, 2022
2 parents 8cbf052 + 570b964 commit ab2c007
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
Expand Up @@ -38,3 +38,6 @@

- Fix panic on empty object node on `pulumi convert`
[#321](https://github.com/pulumi/pulumi-yaml/pull/321)

- Fix type checker inaccurately allows using 'id' property of a component resource
[#324](https://github.com/pulumi/pulumi-yaml/pull/324)
4 changes: 3 additions & 1 deletion pkg/pulumiyaml/analyser.go
Expand Up @@ -663,7 +663,9 @@ func typePropertyAccess(ctx *evalContext, root schema.Type,
for _, prop := range root.Resource.Properties {
properties[prop.Name] = prop.Type
}
properties["id"] = schema.StringType
if !root.Resource.IsComponent {
properties["id"] = schema.StringType
}
properties["urn"] = schema.StringType
case *schema.InvalidType:
return root
Expand Down

0 comments on commit ab2c007

Please sign in to comment.