Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

types: add type name to scope earlier #184

Merged
merged 1 commit into from
Dec 31, 2021
Merged

Conversation

muvaf
Copy link
Member

@muvaf muvaf commented Dec 22, 2021

Description of your changes

I ran into a case where the resource name is aws_cloudfront_monitoring_subscription and it has a field called monitoring_subscription. The type builder generated MonitoringSubscriptionParameters and MonitoringSubscriptionObservation fields for both the main type and also its field. During printing, only one of them was printed which had no fields, hence we end up in the case where there is a single MonitoringSubscriptionObservation that has no ID field, which broke GetID function.

This change ensures that we add the generated type name to the package scope earlier so that look-ups in the recursive calls of the same type consider the name of the upper level type as well.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Manually with Jet AWS.

@muvaf muvaf requested a review from ulucinar December 22, 2021 14:10
…alls see them, otherwise duplicates can be produced

Signed-off-by: Muvaffak Onus <me@muvaf.com>
@muvaf muvaf merged commit b93ec8a into crossplane:main Dec 31, 2021
@muvaf muvaf deleted the fix-recur branch December 31, 2021 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants