notification-controller: Enterprise github repo: not generating events and unable to write commit status to github

Team, version using : flux2 v0.8.0 events are not generating and unable to write commit status to github about the deployment

Following is error noticing in notification controller log… It was supposed to fetch from my github domain but it’s trying to fetch from api.github.com please check following error **```

{“level”:“error”,“ts”:“2021-03-12T18:40:29.577Z”,“logger”:“event-server”,“msg”:“failed to send notification”,“object”:“platform/badlybehavingtestservice”,“kind”:“Kustomizatio │ │ n”,“error”:“could not list commit statuses: Get "https://api.github.com/repos/s-voggu/eks/commits/d1cc91e17c740a4d203e8eef04b8312bab47f46b/statuses?per_page=50\”: net/http:



In gitrepository type resource I'm using ssh repo url and able to fetch latest commit status...In providers I'm using https repo url in address field.  In gitrespositry resource and kusomization resource events are getting generated but I don't see any events in alerts and providers . Observing above error in notification controller log please assist asap

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (5 by maintainers)

Most upvoted comments

I cant really in good faith submit a PR and release something which I do not know works. You do not need a full cluster to test this, it would work if you install flux on a kind cluster locally on your computer which pulls from your GitHub instance. Could you do that?

@sairamvoggu1007 I created a draft PR to track any code comments. https://github.com/fluxcd/notification-controller/pull/162

Just checkout the branch and build+push the image to some image registry. Then replace the image used for notification-controller in your “fleet-infra” repository. I do not know if there are any major CRD changes between 0.8 and 0.9 that would complicate testing this, try and see if it works.

I moved this issue to the NC so you do not need to create a new issue @sairamvoggu1007

I can probably answer why this is not working for GitHub enterprise. The reason is most likely because the provider was never built with self hosted Github in mind. If you look at the part that initiates the Github client it ignores the host. https://github.com/fluxcd/notification-controller/blob/a61680e4c986103d70afa95c74939699e535bb45/internal/notifier/github.go#L54

Instead the client needs to be specifically created for Github enterprise. https://github.com/google/go-github/blob/51f17753badd669f62e5cc9ead041328e2087f4e/github/github.go#L309

Thanks @simongottschlag for filling me in, it helped getting all the details. I can create a PR which adds support for GH enterprise if you @sairamvoggu1007 can test it for me.

Hi!

Now when the token has the correct encoding, we’re hitting the issue with GitHub Enterprise not being supported by the notification-controller.

I do recommend creating the feature request for the notification-controller 😊👍