##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Elasticsearch Indices will be created with timestamp suffix
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
##### ISSUE TYPE
- Bug fix Pull Request
##### SUMMARY
The empty command `@BotKube` is managed in the executor.go file for having a identic behaviour on all intergrations but the Slack bot is handling it differently.
So I proposed a cleanup in this PR.
##### ISSUE TYPE
- Feature Pull Request
##### SUMMARY
adding support for botkube to interact in slack threads
I did update the test bash script that would not run on my zsh shell on my mac.
I Also wanted to add some unit tests but the Slack test server does not support thread messages.
Fixes#422
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Correctly indent RBAC rules. It was previously throwing an error when enabling both psp and rbac at the value level.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#325
- Validates error events are skipped when the error event is not configured for a resource in test config.
- Validate that error events are skipped when an event occurs for a namespace which is not added in resource_config
Fixes part of #340
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Corrected spelling mistakes in documentation comments, changed cases for references to BotKube for consistency across docs, and added code markdown to kubectl reference for consistency
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
Added skip delete event test case that should be skipped if event occurred for a resource which is not added in test configuration.
Modified AllowedEventKindsMap to removed the v1/services resource
<!--- Please list dependencies added with your change also -->
Fixes test case - Validate that delete events are skipped when an event occurs for a resource which is not added in resource_config of issue #354
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Added skip update event test case that should be skipped if invalid Fields are provided in UpdateSettings test config.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes test case - Validate that update events are skipped when invalid fields are passed in updateSetting (e.g status.invalid for Pod) #341
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
I added proper hyperlinks to slack, mattermost and microsoft teams
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Added skip delete event test case that should be skipped for namespaces which are not configured for delete event in test config.
Modified the resource configuration map AllowedEventKindsMap and removed delete event for namespace test.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes test case - Validate that delete events are skipped when an event occurs for a namespace which is not configured of issue #354
##### ISSUE TYPE
- Docs Pull Request
##### SUMMARY
- Added license, slack & release badges
- added period at end of sentence
Fixes
- changed in README.md file
This Commit,
- Adds Debug logs to slack and matter most bot to log the valid request sent to the bot and the corresponding responses generated.
- removes the logging to all events, to avoid capture of sensitive data.
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Created this as a separate PR, as it not connected with Discord Integration.
added these features there as well.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
#### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
**Add support for Discord:**
This PR,
- adds discord bot
- adds discord notifier
- adds required discord configurations into comm_config.yaml
- adds discordgo module into go.mod
- adds discord configs into all yaml files
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#97
### Steps For Creation and Integration:
1. Reach https://discordapp.com/developers/applications
2. Create New Application named Botkube and add a bot named **Botkube** into the Application
3. Copy the Application **CLIENT ID** and place it under _Dischord.botid_ in comm-config.yaml
4. Copy Bot **TOKEN** and place it under _Dischord.token_ in comm-config.yaml
5. Generate the URL with suitable permissions using the OAuth2 URL Generator available under OAuth2 section to the add bot to your Discord server
```
https://discordapp.com/oauth2/authorize?&client_id=<YOUR_CLIENT_ID>&scope=bot&permissions=<SET_OF_PERMISSIONS>
```
6. Paste the generated URL in a new tab, select the discord sever to which you want to add the bot and Authorise Bot addition.
7. Create a new channel and/or copy the **CHANNEL ID** of an existing one that you want to use and place it under _Dischord.channel_
```yaml
# Settings for Discord
discord:
enabled: true
token: 'DISCORD_TOKEN' # BotKube Bot Token
botid: 'DISCORD_BOT_ID' # BotKube Application Client ID
channel: 'DISCORD_CHANNEL_ID' # Discord Channel id for receiving BotKube alerts
notiftype: short # Change notification type short/long you want to receive. notiftype is optional and Default notification type is short (if not specified)
```
#### Note: Follow the first 4 mins of this [Video Tutorial](https://youtu.be/8o25pRbXdFw) to understand the process visually.
### Preview:
![ping](https://user-images.githubusercontent.com/30741615/80600577-3931cf00-8a4a-11ea-9215-a725a0b17256.png)
![pod-create-short](https://user-images.githubusercontent.com/30741615/80600638-55357080-8a4a-11ea-976f-b91e823c93bd.png)
![pod-error-long](https://user-images.githubusercontent.com/30741615/80600803-8dd54a00-8a4a-11ea-90e4-a205e93aba5f.png)
![file-attachment](https://user-images.githubusercontent.com/30741615/80600724-75fdc600-8a4a-11ea-9b10-1b5ac0e79548.png)
Inserting 'the' before required in line 15.
Inserting 'the' before build in line 113
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
- Bug fix Pull Request
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes #XXX
##### ISSUE TYPE
- Feature Pull Request
##### SUMMARY
Created a script to create and destroy KIND clusters which can be used to execute test and CD jobs. Added make targets for those and default make help.
Fixes#320
This Commit,
- Fixes build failure due to e2e tests
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#384
Fixes issue #295
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This change allows to ignore whole sets of namespaces using the asterix expansion. It still does the exact match check for all the namespaces (separated by comma in config), but if it contains a `*`, it's actually replaced with `.*` and passed to `regexp.MatchString` to do the job.
PR also contains couple of very simple test cases.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
deps:
`namespace_checker.go` now imports also `regexp`
Fixes#295
It's my very first golang code, so please let me know if it's not idiomatic go 🍪
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Added a e2e test kubectl command with forbidden verb and forbidden resource. Another one for kubctl command with allowed verb and forbidden resource
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#350
ISSUE TYPE
- Docs Pull Request
SUMMARY
Add Licence reference badge in README
Add licence related info in README
##### ISSUE TYPE
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Add Licence reference badge in README for getting visible at first glance
Add licence related info in README
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Signed-off-by: Binit Ghimire <thebinitghimire@gmail.com>
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
I resolved a grammatical mistake in **Line 15** of the documentation.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#353
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Added skip delete event test case that should be skipped for resources which are not configured for delete event in test config.
Modified the resource configuration map AllowedEventKindsMap and removed delete event for pod.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes test case - Validate delete events are skipped when delete event is not configured for a resources in test config. e.g events: [create, update, error] of issue #354
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Added tests for Update Events, here added a pod and then updated its specifications to verify the updated message in the generated event. Also, the diff method is verified for the updated change
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Modification : Changed resource_config.yaml for Integration Testing, Added update Event for POD
Fixes part of #341
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Docs Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#353
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Typo fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->fixed a typo
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Fixed spelling of word 'communication'. Changed **commucation** to **communication**.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#357
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
##### ISSUE TYPE
- Docs Pull Request
##### SUMMARY
- Update all-in-one yamls for Teams support
- Add sample res config for custom resources
##### ISSUE TYPE
- Bug fix Pull Request
##### SUMMARY
Jsonpath eval fails if fields are not set in old obj by the time event issued. Ignore error in that case and continue message construction
Signed-off-by: Rahul M Chheda <rchheda@infracloud.io>
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug fix Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#333
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
- Bug fix Pull Request
- Docs Pull Request
Feature Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
- Added creation of Dynamic ClientSet
- Replaced the current k8s resources to DynamicInformer
- Added logic to create metav1.ObjectMeta/ metav1.TypeMeta from obj interface{}
- Added GKE auth pkg
- Modified fns to get ObjectMeta, and ObjectTypeMeta
- Added function to create *coreV1.Event from the obj interface{}
- Improved switch case for event.New()
- Added for loop to create informer
- Changed Name for fn GetAnnotaion to GetAnnotationFromEvent
- Changed Parsing Logic for GCR (using '/')
- Added logic in FilterEngine, to get the appropriate data
- Full deprecate kubeClient init
- Added logic to fetch resources from DynamicKubeClient
- Added a fn to transform a object form ibj interface{}
- Added REST Mapper to map all resources present on the cluster
- Declared this REST Mapper as global for further use
- Removed logic to filter out the Kubernetes resources according to Involved Object kind
- Removed constants from utils.go
In the latest commit:
- To pass the e2e tests, just replaced all kubernetes resources informer, with dynamic informer.
- Unable to pass the e2e test suite (will paste the error in the comments.)
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes https://github.com/infracloudio/botkube/issues/200
##### ISSUE TYPE
- Feature Pull Request
##### SUMMARY
Added new botkube command to list all the supported commands, @botkube commands list
Below are the changes
made changes in executor.go to handle newly added command
added common method in utils.go to format the allowed commands
Fixes https://github.com/infracloudio/botkube/issues/312
##### 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.`
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
- Add support for Microsoft Teams
- Multicluster support not available yet for Teams
Integration tests will be addressed with a separate issue. Blocked by https://github.com/infracloudio/msbotbuilder-go/issues/46Fixes#60
##### ISSUE TYPE
- Feature Pull Request
##### SUMMARY
In the notifier, we send events by creating a new connection to the communication medium on every new event. We can reduce the number of connections by sending messages via the Bot interface.
Fixes#270