An app that helps you monitor your Kubernetes cluster, debug critical deployments & gives recommendations for standard practices
Go to file
Deniz Hornig e94e9142b7
Fix crash on empty command in mattermost integration (#326)
##### ISSUE TYPE
 - Bug fix Pull Request

##### SUMMARY
This should fix panic on empty command. 
Bot will send the default message for the executor Platform (in my case its mattermost)

##### What did you do?
Sent empty command to botkube via mattermost (type @botkube)
##### What did you expect to see?

> Command not supported. Please run /botkubehelp to see supported commands.

or at least nothing 

##### What did you see? 
`panic: runtime error: index out of range [0] with length 0
goroutine 28 [running]:
github.com/infracloudio/botkube/pkg/execute.(*DefaultExecutor).Execute(0xc000a11020, 0x0, 0x0)
        go/src/github.com/gohumble/botkube/pkg/execute/executor.go:191 +0xe13
github.com/infracloudio/botkube/pkg/bot.(*mattermostMessage).handleMessage(0xc000b75de8, 0xc0003d1940, 0x1a, 0xc00046b7c0, 0x5, 0xc00046b7cc, 0x4, 0xc00046b120, 0xd, 0x1, ...)
        go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:154 +0x54e
github.com/infracloudio/botkube/pkg/bot.MMBot.listen(0xc0003d1940, 0x1a, 0xc00046b7c0, 0x5, 0xc00046b7cc, 0x4, 0xc00046b120, 0xd, 0x1, 0xc0003d1880, ...)
        go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:253 +0x4d1
github.com/infracloudio/botkube/pkg/bot.(*MMBot).Start.func1(0xc00058f4d0)
        go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:125 +0x2c7
created by github.com/infracloudio/botkube/pkg/bot.(*MMBot).Start
        src/github.com/gohumble/botkube/pkg/bot/mattermost.go:113 +0x712
Exiting.`
2020-08-19 10:47:50 +00:00
.github Remove travis CI integration (#281) 2020-05-14 13:13:43 +05:30
branding/logos Add BotKube icons for reference (#316) 2020-07-27 12:38:50 +00:00
build Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
cmd/botkube Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
design Added support for Mattermost 2019-04-04 16:31:53 +05:30
hack Fixes #179: Migration of current travis ci to github-actions ci. (#244) 2020-05-14 10:32:03 +05:30
helm/botkube Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
pkg Fix crash on empty command in mattermost integration (#326) 2020-08-19 10:47:50 +00:00
test Refactor notifier to use Bot interface to send notifications (#309) 2020-07-13 12:06:27 +00:00
.gitignore Added restrictAccess flag to restrict BotKube command execution 2020-01-01 18:10:25 +05:30
.mergify.yml Mergify: configuration update (#287) 2020-06-16 10:06:19 +05:30
.release Release v0.10.0 2020-04-27 09:58:06 +05:30
botkube_arch.jpg Update BotKube architecture diagram (#263) 2020-04-23 10:36:58 +05:30
botkube-title.jpg Added image 2019-01-24 15:23:48 +05:30
CHANGELOG.md Release v0.10.0 2020-04-27 09:58:06 +05:30
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-03-01 14:25:34 +05:30
comm_config.yaml Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
CONTRIBUTING.md Update CONTRIBUTE.md to work with the latest changes (#237) 2019-12-23 23:20:49 +05:30
deploy-all-in-one-tls.yaml Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
deploy-all-in-one.yaml Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
go.mod Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
go.sum Add MS Teams support (#242) 2020-08-11 06:12:09 +00:00
LICENSE Add license headers to source files (#266) 2020-04-27 09:20:16 +05:30
Makefile Use infracloudio/botkube repo for docker images 2019-09-30 14:35:27 +05:30
README.md Remove travis CI integration (#281) 2020-05-14 13:13:43 +05:30
resource_config.yaml Make allowed kubectl commands configurable (#284) 2020-06-21 11:26:30 +00:00

BotKube

CI Go Report Card BotKube website GoDoc Release Version

For complete documentation visit www.botkube.io

BotKube integration with Slack or Mattermost helps you monitor your Kubernetes cluster, debug critical deployments and gives recommendations for standard practices by running checks on the Kubernetes resources. You can also ask BotKube to execute kubectl commands on k8s cluster which helps debugging an application or cluster.

Getting started

Please follow this for complete BotKube installation guide.

Architecture

  • Informer Controller: Registers informers to kube-apiserver to watch events on the configured k8s resources. It forwards the incoming k8s event to the Event Manager
  • Event Manager: Extracts required fields from k8s event object and creates a new BotKube event struct. It passes BotKube event struct to the Filter Engine
  • Filter Engine: Takes the k8s object and BotKube event struct and runs Filters on them. Each filter runs some validations on the k8s object and modifies the messages in the BotKube event struct if required.
  • Event Notifier: Finally, notifier sends BotKube event over the configured communication channel.
  • Bot Interface: Bot interface takes care of authenticating and managing connections with communication mediums like Slack, Mattermost. It reads/sends messages from/to commucation mediums.
  • Executor: Executes BotKube or kubectl command and sends back the result to the Bot interface.

Visit www.botkube.io for Configuration, Usage and Examples.