open-cluster-management-io / addon-framework

addon apis
Apache License 2.0
23 stars 40 forks source link

Allow non-K8S addon hooks #97

Open ctron opened 2 years ago

ctron commented 2 years ago

To me it looks like currently there are "pre deletion" hooks, which make use of the finalizer of a managed addon resource.

However, they only allow one to spawn a pod or a job. Assuming one wants to simply reach to an external API, that would mean spawning a job, with a simple HTTP call.

It would be great if the Agent interface would allow for a PreDelete function, which would handle the same, and report back with: ok, need-more-time, failed. Which is basically the same as a job would, just without spawning additional pods.

qiujian16 commented 2 years ago

/assign @zhiweiyin318

this was used to integrate with helm. but i think it makes sense to extend. @zhiweiyin318 thought?