Skip to content

Conversation

a-hilaly
Copy link
Member

@a-hilaly a-hilaly commented Aug 11, 2022

Fixes aws-controllers-k8s/community#1402

The AWS Lambda API doesn't return the original submitted s3Bucket,
s3Key, and s3ObjectVersion when a function is successfully created.
Instead, it returns different values (In Getfunction call) in a
different response field (Code.Location). This is causing the
generated code in ACK to set the spec.Code.s3* fields to nil values.

To keep the experience in ACK lambda-controller consistent in the
Kubernetes-land, we must keep the original submitted code.S3* fields
part of the function's spec.

This patch removes the part that is setting the spec.Code.s3* to nil
and allows the controllers to keep the original values part of the spec.

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

Signed-off-by: Amine Hilaly [email protected]

The AWS Lambda API doesn't return the original submitted `s3Bucket`,
`s3Key` and `s3ObjectVersion` when a function is successfully created.
Instead, it returns different values (In `Getfunction` Call) in a
different response field (`Code.Location`). This is causing the
generated code in ACK to set the `spec.Code.s3*` fields to nil values.

To keep the experience in ACK lambda-controller consistent with the
kubernetes exprience, we must keep the original submitted `code.S3*`
fields part of the function's spec.

This patch removes the part that is setting the `spec.Code.s3` to nil
and allows the controllers to keep the original values part of the spec.

Signed-off-by: Amine Hilaly <[email protected]>
@a-hilaly
Copy link
Member Author

/hold

@ack-bot ack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 11, 2022
@a-hilaly
Copy link
Member Author

/unhold

@ack-bot ack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 11, 2022
@a-hilaly
Copy link
Member Author

/test lambda-unit-test

Copy link
Contributor

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

muy bueno, gracias amigo.

@jaypipes
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 14, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Aug 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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-bot ack-bot merged commit e917f81 into aws-controllers-k8s:main Aug 14, 2022
michaelhtm pushed a commit to rushmash91/lambda-controller that referenced this pull request Feb 5, 2025
…llers-k8s#43)

### Update to ACK runtime `v0.19.1`, code-generator `v0.19.1`

----------

* ACK code-generator `v0.19.1` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.19.1)
* ACK runtime `v0.19.1` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.19.1)

----------

NOTE:
This PR increments the release version of service controller from `v0.0.17` to `v0.0.18`

Once this PR is merged, release `v0.0.18` will be automatically created for `mq-controller`

**Please close this PR, if you do not want the new patch release for `mq-controller`**

----------

#### stdout for `make build-controller`:

```
building ack-generate ... ok.
==== building mq-controller ====
Copying common custom resource definitions into mq
Building Kubernetes API objects for mq
Generating deepcopy code for mq
Generating custom resource definitions for mq
Building service controller for mq
Generating RBAC manifests for mq
Running gofmt against generated code for mq
Updating additional GitHub repository maintenance files
==== building mq-controller release artifacts ====
Building release artifacts for mq-v0.0.18
Generating common custom resource definitions
Generating custom resource definitions for mq
Generating RBAC manifests for mq
```

----------

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
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.

Lambda controller removing code: block
3 participants