Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test for executing kubectl command on forbidden verbs and resources #350

Closed
PrasadG193 opened this issue Sep 28, 2020 · 6 comments · Fixed by #374
Closed

Add e2e test for executing kubectl command on forbidden verbs and resources #350

PrasadG193 opened this issue Sep 28, 2020 · 6 comments · Fixed by #374
Assignees
Labels

Comments

@PrasadG193
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Missing kubectl command test coverage for negative test-cases

Describe the solution you'd like

BotKube can be configured to allow access to specific kubectl commands only - https://github.com/infracloudio/botkube/blob/develop/test/resource_config.yaml#L224

Add a test case to execute kubectl command on a forbidden resource and a verb.
Add the test cases in the table-driven test map https://github.com/infracloudio/botkube/blob/develop/test/e2e/command/kubectl.go#L46

@anoopmsivadas
Copy link
Contributor

@PrasadG193 Can You assign me on this one as well

@PrasadG193
Copy link
Collaborator Author

Sure!

@anoopmsivadas
Copy link
Contributor

Hi @PrasadG193 all i have to do is add one test case with a forbidden verb and a resource, right?

@PrasadG193
Copy link
Collaborator Author

Yes, that should suffice, we already have test coverage for command with allowed verbs/resources

@anoopmsivadas
Copy link
Contributor

@PrasadG193 I'm adding 2 test cases one with a forbidden verb and forbidden resource, and another one with allowed verb and a forbidden resource. is that fine?

@PrasadG193
Copy link
Collaborator Author

Sounds good. Thanks, @anoopmsivadas

@mergify mergify bot closed this as completed in #374 Oct 1, 2020
mergify bot pushed a commit that referenced this issue Oct 1, 2020
##### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants