Commit Graph

133 Commits

Author SHA1 Message Date
Prasad Ghangal
f349853c51
Publish multi-arch images with goreleaser (#509)
##### ISSUE TYPE
 - Feature Pull Request

##### SUMMARY
- Switch to goreleaser for building and publishing release
- Set BotKube version with build args
- Use docker manifest to build multi-arch image
- Update CI pipeline to build and push image using goreleaser

Fixes #504 

```
$ docker manifest inspect ghcr.io/prasadg193/botkube:latest
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1370,
         "digest": "sha256:64d94709256eb85452afa06aa15574724266fa6b82b70654ff6b03c467d5a5e4",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1160,
         "digest": "sha256:525d79e629637fd1ae3530223fa380aea26ed299a1fd9ae2787721f4cc33dad5",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1160,
         "digest": "sha256:ef72bc09078929c8aed1161f86c2c86523f6fac664094a034c737ffd582f3ea7",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1160,
         "digest": "sha256:990cd2c6b522a3a69ba73ee83ed0ae306102369f02d09891de8fbfd024d37e87",
         "platform": {
            "architecture": "arm",
            "os": "linux",
            "variant": "v7"
         }
      }
   ]
}

```
2021-08-19 10:56:22 +05:30
Thijs de Jong
6ced5ead92
Fix panic when running command without resource (#447)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This fixes a panic when running a command with an allowed verb but without a resource. For example: `@Botkube get`.
<!---
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 -->
2021-07-21 05:33:03 +00:00
David Costa
bcda42a77e
Allow skipping certs validation of Elastic (#487)
* Allow skipping certs validation of Elastic

Allow user to skip certificate validation when connecting to the
Elasticsearch cluster (opt-in). It permits to use botkube with clusters
that don't have certificates signed by a CA that is trusted by the
botkube image, it often happens with clusters that are for internal use
only.

See #485

Co-Authored-By: Carmine Di Monaco <carmine.dimonaco@computer.org>

* Update go.sum

* Add the default value of skipTLSVerify in deploy manifests

Co-authored-by: David Costa <david@zarel.net>

* Add skipTLSVerify elasticsearch option to helm chart

Co-authored-by: David Costa <david@zarel.net>

* Bool instead of boolean in helm chart docs for skipTLSVerify elastic

Co-authored-by: David Costa <david@zarel.net>

Co-authored-by: Carmine Di Monaco <carmine.dimonaco@computer.org>
Co-authored-by: Carmine Di Monaco <carmine.dimonaco@gmail.com>
2021-07-02 09:25:06 +05:30
Herman
08f4d1e3f0
Test and document adding updateSetting for complex annotation keys (#491)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Docs Pull Request

##### SUMMARY
We wanted to add `updateSetting` for an annotation from the Kubernetes Apps SIG. This annotation contains dots and slashes. I wasn't sure which field to use, so I've updated the test to make it very clear that it requires the syntax of number 1:
1. `metadata.annotations.app\.kubernetes\.io\/version`
2. `metadata.annotations["app.kubernetes.io/version"]`
<!--- Please list dependencies added with your change also -->

Fixes #XXX
2021-07-02 03:09:00 +00:00
Goir
3d48fded42
allow configration of Mattermost Username (#455)
##### ISSUE TYPE
 - Bug fix Pull Request

##### SUMMARY
Allow Configuration of Mattermost user and fixes BUG with getUser() if its not the "BotKube" default user.

Fixes #245
2021-05-21 13:57:13 +00:00
Prasad Ghangal
aeed283a98
Update Go and pkg deps (#475) 2021-04-24 20:06:01 +05:30
Kartik Moolya
993adfef41
Generating credentials using WebhookIdentity on AWS (#463)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Capability to fetch AWS credentials from the EKS OIDC provider
<!---
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 #462
2021-03-17 08:44:50 +00:00
Girish Talekar
23498c01bb
remove unwanted hyperlink text from command (#461)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
When clustername is passed to botkube from command and if that clustername contains valid domain then slack automatically adds <http:// to the url  
eg.  
if command is `@BotKube get pods --cluster-name xyz.alpha-sense.org`  then in botkube we get cluster name as `<http://xyz.alpha-sense.org|xyz.alpha-sense.org>`

#### Solution:
Added small logic in executor code to remove the unwanted string

Fixes https://github.com/infracloudio/botkube/issues/460
2021-03-10 06:34:45 +00:00
Girish Talekar
00c0c570ea
corrected defaultNamespace population and avoid appending defaultnamespace if already passed (#459)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Resolved issue of DefaultNamespace value is not getting populated in config and appending default namespace if another namespace is already passed
2021-02-24 16:21:41 +00:00
Prasad Ghangal
a9eb8de69f
Remove whitespaces in the responses (#452)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY

Remove whitespaces in the command responses

![image](https://user-images.githubusercontent.com/7098659/106181497-acc46080-61c3-11eb-86f4-6a0233a14b59.png)
2021-01-28 18:36:17 +00:00
Prasad Ghangal
27fc6ed767
Use uniform response format (#451)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>

##### ISSUE TYPE
 - Feature Pull Request

##### SUMMARY
Use uniform `codeblock` format for command responses across different integrations 

![image](https://user-images.githubusercontent.com/7098659/105995940-ac4a9d80-60cf-11eb-9f7f-962bcc626968.png)
2021-01-28 05:00:08 +00:00
Prasad Ghangal
5ff16d0b46
Fix namespace checker filter (#449)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>

##### ISSUE TYPE

 - Bug fix Pull Request


##### SUMMARY

Fix namespace checker filter issue where events with ignored namespaces were not getting skipped 

Fixes #419
2021-01-20 06:49:48 +00:00
Kuntal Majumder
14c8c9d4d2
Fixed namespace checker to use the correct name (#437)
##### ISSUE TYPE
 - Bug fix Pull Request

##### SUMMARY
Apparently the wrong member was used to check the resource name. I don't
know how resillient this patch is, but it works for most of the part.

<!--- Please list dependencies added with your change also -->

Fixes #419
2021-01-04 10:16:23 +00:00
Prasad Ghangal
bcd48cd8ca
Fix notification timestsamp in Discord (#442)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY

Use correct timestamp in Discord event notification 

Fixes #441 

##### Test plan

![image](https://user-images.githubusercontent.com/7098659/103475090-43be1880-4dd0-11eb-9a5c-2406d2d4f954.png)
2021-01-03 09:44:18 +00:00
Kuntal Majumder
24bdc7e46a
Cluster name for commands (#438)
##### ISSUE TYPE
 - Bug fix Pull Request

##### SUMMARY
Checks for the cluster name for the `commands list` command if passed.

Fixes #420 

![2020-12-10-115425_1920x1080_scrot](https://user-images.githubusercontent.com/12135951/101729661-97de2180-3ade-11eb-986b-123398a89a2e.png)
2020-12-13 14:11:57 +00:00
Kartik Moolya
5ad31edb4b
[ES] indices to be created with daywise timestamp (#430)
##### 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 -->
2020-11-09 13:21:36 +00:00
sgandon
cb8ed93ae0
feat(slack): clean up empty cmd handling (#424)
##### 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.
2020-11-09 13:08:00 +00:00
sgandon
0ad0536512
feat(slack): add thread support (#423)
##### 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
2020-11-03 08:42:01 +00:00
michizhou
c4531a21b2
Fix spelling and change case in comments and docs (#411)
##### 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 -->
2020-10-16 10:33:19 +00:00
Akanksha kumari
c4604a6312
added test for skip delete event when resources are not added in test_config (#405)
##### 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
2020-10-14 12:14:54 +00:00
Aananth K
d051509535
Track only valid requests and responses (#404)
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 -->
2020-10-06 04:50:55 +00:00
Aananth K
ad9a738cdd
Add Discord support (#268)
#### 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)
2020-10-06 04:37:49 +00:00
Sanket Sudake
5974581b13
Codespell action for BotKube (#394)
This commit adds GitHub action which checks for common misspellings across repository.
2020-10-05 12:26:10 +05:30
Aananth K
b087f94804
Bug Fix e2e tests (#389)
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
2020-10-05 04:11:09 +00:00
Jirka Kremser
86d2572e56
Add a support for ignoring the events from a namespace that matches regexp (#386)
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 🍪
2020-10-02 16:07:09 +00:00
John Bampton
741eca75ea
Fix spelling (#385)
##### ISSUE TYPE

 - Docs Pull Request
2020-10-01 16:52:57 +00:00
Akanksha kumari
bc983c3aac
e2e Test coverage for update event (#351)
##### 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
2020-10-01 06:30:50 +00:00
Prasad Ghangal
075e92d6a5
Fix for missing update diff for first update event (#345)
##### 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
2020-09-26 14:07:52 +00:00
Prasad Ghangal
f4994f1305
Fix update and error event skip issue (#343)
##### ISSUE TYPE
 - Feature Pull Request

##### SUMMARY

- Fix Allowed maps checks
- Update diff calculation logic

Fixes #339 #342
2020-09-21 05:47:18 +00:00
Rahul M Chheda
87b7480a5a
(fix) Validate Resource before enabling an Informer against it. (#335)
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
2020-09-14 09:11:44 +00:00
Akanksha kumari
a64b24d8b6
Initialized the DiscoveryClient Variable (#337)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
Fixes #336
2020-09-10 11:00:07 +00:00
Rahul M Chheda
c326015ec0
(feat.) creation of SharedInformer from Dynamic ClientSet (#253)
##### 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
2020-09-07 03:42:32 +00:00
Girish Talekar
ae980c7f74
Added '@Botkube commands list' to show all the supported kubectl cmds (#328)
##### 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
2020-09-02 04:52:14 +00:00
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
Prasad Ghangal
c6db9526a3
Add MS Teams support (#242)
##### 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/46

Fixes #60
2020-08-11 06:12:09 +00:00
Prasad Ghangal
b887214b6c
Refactor notifier to use Bot interface to send notifications (#309)
##### 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
2020-07-13 12:06:27 +00:00
Kartik Moolya
4f1d87239e
allow using AWS role or EC2 Instance role for Elasticsearch Auth (#306)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Allow using AWS role or EC2 Instance role to generate session tokens for AWS credentials.
<!---
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 -->
2020-07-02 17:01:01 +00:00
kartik-moolya
57491857fc
adding feature to support AWS Signing and creating new index per day (#302)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->

Allows user to specify if Elasticsearch is hosted on AWS
- configuration fields have been added to specify if Elasticsearch is hosted on AWS

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
Includes feature which would allow botkube to send Kubernetes events to Elasticsearch hosted on AWS
* Uses AWS V4 signature to sign the http request
* Uses environment variables to pick AWS configurations

Secondly creates new index per day with index name suffixed as -DD-MM-YYYY
<!--- Please list dependencies added with your change also -->

Fixes #299 
Fixes #283
2020-07-01 12:27:38 +00:00
gmkumar2005
cc3fc6d554
Allow kubectl commands wihtout namespace and without cluster-name (#301)
##### ISSUE TYPE
     - Bug fix Pull Request

    ##### SUMMARY
    Default executor is expecting more than 2 arguments.
    Fixed number of arguments needed to 1.

Fixes #300
2020-06-30 09:52:50 +00:00
Girish Talekar
51f0f3d2b1
Make allowed kubectl commands configurable (#284)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
Added configuration in resource_config.yaml for limiting kubectl commands as per the discussion given in ticket 183

The configuration added is used in 
slack.go and mattermost.go to pass it to executor.go and used to limit the commands execution

Fixes #183
2020-06-21 11:26:30 +00:00
Harshit mahjan
fc0e324055
Refactor logging package (#262) (#285)
##### ISSUE TYPE

 - Refactor Pull Request  (#262)


##### SUMMARY
Refactor logging package to make log statements simpler. Current format logging.Logger.Info() doesn't look good. We can embed Logrus into pkg/log to import and use it as log.Info()


Fixes #
- Embed Logrus into pkg/log 
- Update the reference to new log package
- Change the reference everywhere form 
    `logging.Logger.Function() --> log.Function()`
2020-06-16 04:43:56 +00:00
Prasad Ghangal
8dce65a7ad
Refactor notifier and bot to pass config
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request


##### SUMMARY

Refactor notifier and bot to pass config
Simplify ElasticSearch client creation
2020-05-01 13:47:37 +00:00
Aananth K
ebd2c93474
Configure default namespace for kubectl cmds through config
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This Commit,
- Adds `kubectl.Enabled`, `Kubectl.DefaultNamespace` to `Config.Settings` to configure default namespace, under which all  botkube kubectl commands will be executed by default.
- changes `Settings.RestrictAccess` into `Settings. Kubectl.RestrictAccess` 
- updates all config.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 #176

**Preview**:

```yaml
settings:
  # Kubectl executor configs
  kubectl:
    # Set true to enable kubectl commands execution
    enabled: false
    # set Namespace to execute botkube kubectl commands by default
    defaultNamespace: default
    # Set true to enable commands execution from configured channel only
    restrictAccess: false
```
2020-05-01 13:38:10 +00:00
Prasad Ghangal
c683c06f2f
Fix mergify config path (#273)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-05-01 18:06:48 +05:30
Prasad Ghangal
2481e934fb
Enable auto merge using Mergify on approval (#271)
##### ISSUE TYPE

 - Feature Pull Request

##### SUMMARY

Enable auto merge using Mergify on approval
Workflow:
- Developer opens a PR
- Reviewer approves the changes and adds `ready-to-merge` label
- Mergify runs CI again and merges the PR
- Mergify holds the auto merge if `hold-off-merging` label is set
2020-05-01 17:10:28 +05:30
Prasad Ghangal
ecde3184e3
Add license headers to source files (#266)
Update copyright years t0 2019-2020 in license

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-04-27 09:20:16 +05:30
Aananth K
b016f060a1
Fix Node getting ready is reported as an error (#261)
This Commit,
- changes the event type created during NodeReady as InfoEvent.
- adds corresponding InfoEvent case in the notify package.
2020-04-22 16:22:43 +05:30
Girish Talekar
a75470ab2d
Checked cluster name before executing kubectl command (#243)
* corrected commit and added only required files

* added new test case

* removed blank assignment
2020-02-06 23:41:15 +05:30
Prasad Ghangal
20f035a450 Add json tags in diff tests
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-01-09 19:15:43 +05:30
surbhi
12e166a39f Add tests for jsonpath support 2020-01-09 19:15:43 +05:30