Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
##### ISSUE TYPE - Bug fix Pull Request ##### SUMMARY ~⚠️ **NOTE:** This PR depends on #603 and needs to be rebased when #603 is merged. Actual changes: da0a7befa39b9e3b68f81734e428d584b6ec9b8f~ This PR fixes Teams and possibly also Lark integrations. Since v0.12.4 MS Teams HTTP server didn't handle requests properly because of 404 errors. It was caused by using default HTTP handlers configuration, which was changed in #603. However, #603 still didn't solve the issue fully, as the servers still didn't handle proper prefixes. This PR introduces https://github.com/gorilla/mux which can handle paths by prefix. Please see the details: #606 (comment) Fixes #606 ##### TESTING Checkout this PR and install BotKube: ```bash cat > /tmp/values.yaml << ENDOFFILE communications: teams: enabled: true appID: 'dbf68a92-26a0-4305-8e9b-8616500abf2f' appPassword: 'abc' config: settings: clustername: sample kubectl: enabled: true image: registry: docker.io repository: pkosiec/botkube tag: fix-bot-srvs # this image was repushed after rebase ENDOFFILE helm install botkube --namespace botkube ./helm/botkube -f /tmp/values.yaml --wait ``` Forward port: ```bash kubectl port-forward -n botkube svc/botkube 3978 ``` And test these calls: ```bash curl http://localhost:3978/metrics # not anymore, metrics are now accessible only under 2112 port as they should curl http://localhost:3978/bots/teams # it works curl http://localhost:3978/bots/teams/v1/messages # it works ``` You can also edit service to check the metrics server (you can also do it from Helm chart configuration, but the ServiceMonitor CRD needs to be available in the cluster): ```bash kubectl edit svc -n botkube botkube ``` ```yaml spec: # (...) ports: # (...) - name: metrics port: 2112 targetPort: 2112 ``` Forward port: ```bash kubectl port-forward -n botkube svc/botkube 2112 ``` And test these calls: ```bash curl http://localhost:2112/metrics # not anymore, metrics are now accessible only under 2112 port as they should curl http://localhost:2112/bots/teams # doesn't work anymore ``` Unfortunately, I couldn't test Lark integration as there's no instruction how to set it up, and I couldn't start the server with invalid/empty credentials.
- Loading branch information
Showing
6 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters