aws-controllers-k8s / community

AWS Controllers for Kubernetes (ACK) is a project enabling you to manage AWS services from Kubernetes
https://aws-controllers-k8s.github.io/community/
Apache License 2.0
2.44k stars 258 forks source link

CloudFront Function objects should be PUBLISHED or provide a field to transition their stage #2041

Open doctorpangloss opened 8 months ago

doctorpangloss commented 8 months ago

Describe the bug https://github.com/aws-controllers-k8s/cloudfront-controller/blob/c4173425a03d539642c1bb8817998f49df9248fe/test/e2e/tests/test_function.py#L95

Without a way to publish the function from the resource, users will have to reconcile it manually. Steps to reproduce Create a function Observe there is no way to publish it

Expected outcome Add a stage field or similar; or, always make it published (preferred) so that it can be associated with the origin.

Environment

a-hilaly commented 8 months ago

Hey @doctorpangloss, this is something we purposely left unimplemented, for now. The issue lies in the API not allowing us to unpublish functions. And (correct me if I'm wrong) when you update a function, it switches back to unpublished state? This API behaviour/options are not compatible with kubernetes declarative model.

Maybe we could consider supporting an annotation like cloudfront.services.k8s.aws/auto-publish: "true" which would instruct the controller to automatically publish functions after creation or updates. What do you think?

doctorpangloss commented 8 months ago

And (correct me if I'm wrong) when you update a function, it switches back to unpublished state

Yes this appears to be the case

Maybe we could consider supporting an annotation like cloudfront.services.k8s.aws/auto-publish: "true"

Excellent choice, that would suit my purposes perfectly

a-hilaly commented 8 months ago

@doctorpangloss Do you know how this change might impact the Get/Describe calls? If a function is published should do the controller get the function from Live or Development stage?

ack-bot commented 2 months ago

Issues go stale after 180d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 60d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle stale

ack-bot commented 1 week ago

Stale issues rot after 60d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 60d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle rotten