openfaas-incubator / vcenter-connector

Extend vCenter with OpenFaaS
MIT License
28 stars 8 forks source link

Add event source to OutboundMessage #22

Closed mikejwhitehead closed 4 years ago

mikejwhitehead commented 5 years ago

Here at NVIDIA we manage ~11 different vCenter environments. Therefore, it looks to me as though we'd need to spin up 11 vcenter-connector's, no big deal with that.

The problem I see is that one could have many connectors calling a single function. The function receives the event, but then is stuck guessing at which vcenter the event came from.

I suggest adding event source to the OutboundMessage struct. Sending the source to the function, allowing one to handle events across many vcenters.

Happy to do the PR if this makes sense? Or perhaps you guys can think of another solve?

alexellis commented 5 years ago

Hi Mike,

This proposal makes a lot of sense.

Please go ahead and work on the PR.

You should also take a look at #20 that was merged from @embano1

Alex

embano1 commented 5 years ago

Good suggestion Mike!

One question on the n:1 (vCenters to function) though: how would that work with credentials for the function if it handles multiple vCenters? Are you using linked Mode and a "global" service account for this function then or would you provide a secrets file with credentials for each individual vCenter?

Happy to review the PR!

mikejwhitehead commented 5 years ago

Hey Michael,

Linked mode with a global service account would be ideal. Unfortunately we have some limitations that prevent us from linking all our vcenters, so we have to manage a few sets of credentials. In our case it would be a secrets file.

PR #23 just submitted for your review.