Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cluster name (or something else) to Github commit status context #194

Closed
gmaiztegi opened this issue May 6, 2021 · 6 comments · Fixed by #435
Closed

Adding cluster name (or something else) to Github commit status context #194

gmaiztegi opened this issue May 6, 2021 · 6 comments · Fixed by #435

Comments

@gmaiztegi
Copy link

We run a few clusters with Flux and are moving towards Flux 2 now, and so far the experience is being awesome.

We have seen an issue in this notification controller, and it's that when having multiple clusters posting the commit status for the same resource names (such as kustomization/flux-system), the statuses get overwritten, as they use the <resource type>/<name> as context.

Therefore, it would be awesome if we could add some kind of prefix or suffix to this context in order to distinguish the status posted by the different clusters.

And once again, Flux 2 is great. Thanks for your hard work.

@phillebaba
Copy link
Member

I agree that we should have a second look at this. When we first implemented the commit status feature a lot was unknown. Currently I am solving this by adding the environment or cluster name to the Kustomization resource. This will cause the statuses to be unique between different clusters.

One solution may be to expose some sort of format configuration for the provider. A risk is that users would hit the character limit for a status message. Most of the providers have one but they are not documented so they are found by trial and error. Do you have any suggestion for how this configuration should be implemented in the provider or alert resource @gmaiztegi?

@gmaiztegi
Copy link
Author

I'm not sure on wether it should be on the provide or the alert. It seems that this is a Github specific issue regarding the commit status, although the question might be wether it might be useful to have different alerts with different identifiers, all of them pointing to the Github provider. It's not our use case, nor I can think of any right now, but this seems more flexible.

@gdoctor
Copy link
Contributor

gdoctor commented May 27, 2021

On a related note, adding some cluster metadata to a notification would be extremely valuable. I am also running flux on 20+ clusters now, and we are unable to use the notification controller effectively since we cannot tell where the notification originated without having a separate chat room per notification-controller instance (we are going to have 50 or more clusters so not very reasonable).

@stefanprodan
Copy link
Member

@gdoctor you can add the cluster name to the alert message with spec.summary, docs here: https://fluxcd.io/docs/components/notification/alert/

@bforchhammer
Copy link

bforchhammer commented Sep 23, 2021

Hi, I've also run into the issue described here, and adding the "summary" to an "alert" unfortunately does not seem to do anything in the case of github status messages; github status seem to only contain the kind/name of the referenced object and the event reason as defined in formatNameAndDescription here:

func formatNameAndDescription(event events.Event) (string, string) {

Just mentioning this here in case anyone else stumbles on the same thing... if I understand correctly, there's already other solutions being considered, like the one described here: fluxcd/flux2#1529?

@jrauschenbusch
Copy link

@stefanprodan Is there any progress regarding the dedicated CommitStatus CRD? This would extend the room of enhancements by far (e.g. #225)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants