Skip to content

Adding functionality to assign whole object to a field #451

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
Jun 1, 2023

Conversation

Vandita2020
Copy link
Member

Issue #, if available:
This PR is created to support the code-generation for FunctionEventInvokeConfig feature in lambda-controller. PR#92

Description of changes:
This PR adds functionality to assign whole object to a field, instead of assigning a particular parameter of it. To clarify it further, in the below code, we created a new field LayerStatuses which stores the value of Configuration.Layers parameter taken from GetFunction operation.

LayerStatuses:
        from:
          operation: GetFunction
          path: Configuration.Layers

In our case we needed to add FunctionEventInvokeConfig as an inline property to Function resource, for which we needed to assign the whole object returned by PutFunctionEventInvokeConfig operation to field FunctionEventInvokeConfig. To make this work we added a new condition for it by passing path value as . , shown below:

FunctionEventInvokeConfig:
        from:
          operation: PutFunctionEventInvokeConfig 
          path: .

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from a-hilaly and jaypipes May 26, 2023 03:12
@a-hilaly
Copy link
Member

/retest

Comment on lines +223 to +225
if path == "." {
return &op.InputRef, true
}
Copy link
Member

@a-hilaly a-hilaly May 26, 2023

Choose a reason for hiding this comment

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

Can we have a unit test for this?
Edit: it might be complex as we don't have unit test for api types generation...

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Happy to ship test if e2e tests pass

@ack-prow ack-prow bot added the approved label May 26, 2023
@a-hilaly
Copy link
Member

/cc @jaypipes @RedbackThomson

@RedbackThomson
Copy link
Contributor

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2023
@ack-prow
Copy link

ack-prow bot commented Jun 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, RedbackThomson, Vandita2020

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:
  • OWNERS [A-Hilaly,RedbackThomson]

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 dcb9fd6 into aws-controllers-k8s:main Jun 1, 2023
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.

3 participants