Skip to content

Improve nested fields path and type resolution #490

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

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

a-hilaly
Copy link
Member

This commit improves the getAttributeFromPath function by introducing
a better field path and type resolution mechanism. Now, it considers
aadditional fallback naming conventions, particularly for cases
involving lists.

This is needed to generate type references for Distribution resource
in ACK CloudFront controller. More specifically, the CF API Schema for
the Distribution resource is naming the FunctionAssociations shape
FunctionAssociationsList.

Tested with cloudfront-controller using the following config:

resources:
  Distribution:
    fields:
      DistributionConfig.DefaultCacheBehavior.FunctionAssociations.Items.FunctionARN:
        references:
          resource: Function
          path: Status.ACKResourceMetadata.ARN

Signed-off-by: Amine Hilaly [email protected]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This commit improves the `getAttributeFromPath` function by introducing
a better field path and type resolution mechanism. Now, it considers
aadditional fallback naming conventions, particularly for cases
involving lists.

This is needed to generate type references for `Distribution` resource
in ACK CloudFront controller. More specifically, the CF API Schema for
the `Distribution` resource is naming the `FunctionAssociations` shape
`FunctionAssociationsList`.

Tested with cloudfront-controller using the following config:
```yaml
resources:
  Distribution:
    fields:
      DistributionConfig.DefaultCacheBehavior.FunctionAssociations.Items.FunctionARN:
        references:
          resource: Function
          path: Status.ACKResourceMetadata.ARN
```

Signed-off-by: Amine Hilaly <[email protected]>
@ack-prow ack-prow bot requested review from jlbutler and jljaco January 18, 2024 09:33
@ack-prow ack-prow bot added the approved label Jan 18, 2024
@a-hilaly
Copy link
Member Author

/retest

Copy link

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2024
Copy link

ack-prow bot commented Jan 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, jonathan-innis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit a5ca31a into aws-controllers-k8s:main Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants