crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
137 stars 113 forks source link

Fix update loop for Function.lambda resource #1266

Closed turkenf closed 2 months ago

turkenf commented 2 months ago

Description of your changes

This PR fixes the update loop in the Function.lambda resource.

Fixes: https://github.com/crossplane-contrib/provider-upjet-aws/issues/1027

I have:

How has this code been tested

ulucinar commented 2 months ago

@turkenf, thanks for documenting the manual testing steps. We should also consider capturing this know-how in the uptest manifests (probably by executing them via the pre hooks) and automating the testing. We may even consider using an already available test image (I don't know its cost implications tbh).

mbbush commented 2 months ago

I'm very supportive of @ulucinar's suggestion to fix this by disabling late initialization. It seems like that should fix the issues, but I'd also like to try some creative ideas to break it that will hopefully fail, both for zip lambdas and image-based ones.

AWS Lambda requires that its images come from AWS ECR in the same region as the lambda, but they can be from any aws account, as long as permissions are set appropriately. So I think it would work well to have a small, static lambda image hosted in ECR in a different aws account than is used for testing (so it doesn't get cloud-nuke'd), that we could use for testing from any aws account. It's worth checking, but I'd expect the cost to be minimal.

turkenf commented 2 months ago

/test-examples="examples/lambda/v1beta1/function.yaml"

turkenf commented 2 months ago

I close and re-open to trigger jobs.

turkenf commented 2 months ago

/test-examples="examples/lambda/v1beta1/function.yaml"

Uptest run: https://github.com/crossplane-contrib/provider-upjet-aws/actions/runs/8818842854