Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't panic when annotating with missing objects #11660

Merged
merged 1 commit into from Dec 15, 2022
Merged

Don't panic when annotating with missing objects #11660

merged 1 commit into from Dec 15, 2022

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Dec 15, 2022

Fixes #11658

I have been unable to repro the bug, but since annotateObjectProperties is advisory, I'm adding some defensive nil checks.

@iwahbe iwahbe self-assigned this Dec 15, 2022
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2022-12-15)

Bug Fixes

  • [programgen] Don't panic on some empty objects
    #11660

Copy link
Contributor

@Zaid-Ajaj Zaid-Ajaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just curious though:

In this expression

schemaObjectType, ok := schemaType.(*schema.ObjectType);

if ok && schemaObjectType == nil doesn't that something went wrong in the schema binding?

@iwahbe
Copy link
Member Author

iwahbe commented Dec 15, 2022

LGTM. Just curious though:

In this expression

schemaObjectType, ok := schemaType.(*schema.ObjectType);

if ok && schemaObjectType == nil doesn't that something went wrong in the schema binding?

I think so but I'm not 100% sure, Go has some weird pointer-type semantics. PCL needs to work on invalid inputs though, so we still need the check.

@iwahbe
Copy link
Member Author

iwahbe commented Dec 15, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 15, 2022

Build succeeded:

@bors bors bot merged commit 33cd3e3 into master Dec 15, 2022
@bors bors bot deleted the iwahbe/11658 branch December 15, 2022 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when updating to v3.33.0 of terraform-bridge caused by codegen
3 participants