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

Fix false positive on aws_route resources #404

Merged
merged 3 commits into from
Apr 7, 2021
Merged

Conversation

sundowndev
Copy link
Contributor

Q A
πŸ› Bug fix? yes
πŸš€ New feature? no
⚠ Deprecations? no
❌ BC Break no
πŸ”— Related issues #392
❓ Documentation yes

Description

The AWS route table expander middleware was supposed to turn routes embeded in a route table into dedicated resources. But when a route is already a dedicated resource, the scan result shows it as a deleted resource.

@sundowndev sundowndev added kind/bug Something isn't working next-version/patch labels Apr 2, 2021
@sundowndev sundowndev added this to the v0.7.1 milestone Apr 2, 2021
@sundowndev sundowndev requested a review from a team as a code owner April 2, 2021 16:18
@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #404 (0e001f2) into v0.7 (3f8d5e0) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             v0.7     #404      +/-   ##
==========================================
+ Coverage   69.42%   69.46%   +0.03%     
==========================================
  Files         281      281              
  Lines        6032     6039       +7     
==========================================
+ Hits         4188     4195       +7     
  Misses       1491     1491              
  Partials      353      353              
Impacted Files Coverage Ξ”
pkg/middlewares/aws_route_table_expander.go 89.47% <100.00%> (+0.83%) ⬆️

@sundowndev sundowndev self-assigned this Apr 2, 2021
Copy link
Contributor

@lotoussa lotoussa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -63,11 +63,21 @@ func TestAwsRouteTableExpander_Execute(t *testing.T) {
},
},
{
"test route are expanded",
"test routes are expanded except when it already exist",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it already exists

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you, instead of changing the two current tests, create a new one. One test that won't expand already created routes in a default and a non-default route-table ?

@sundowndev sundowndev requested a review from a team April 6, 2021 13:21
Copy link
Contributor

@eliecharra eliecharra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost all good, I got a small on DRY

pkg/middlewares/aws_route_table_expander.go Outdated Show resolved Hide resolved
Copy link
Contributor

@eliecharra eliecharra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still one last readability comment

pkg/middlewares/aws_route_table_expander.go Outdated Show resolved Hide resolved
following code review feedback. pkg/middlewares/aws_route_table_expander.go
Copy link
Contributor

@eliecharra eliecharra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘πŸ»

@sundowndev sundowndev merged commit 07b7712 into v0.7 Apr 7, 2021
@sundowndev sundowndev deleted the fix/awsRouteExpander branch April 7, 2021 09:19
Copy link
Contributor

@wbeuil wbeuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO !

@sundowndev sundowndev mentioned this pull request Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants