-
Notifications
You must be signed in to change notification settings - Fork 53
Add route table assocations to internet gateway #149
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
Conversation
Hi @nnbu. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I have followed the same model that introduced routeTables field in subnet spec. It allowed route table association to subnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hold as we will release a new code gen version in the next few hours/days.
/ok-to-test
/hold
Were you referencing this issue aws-controllers-k8s/community#1893 ? Now that it is closed, do I need to generate the code again? |
@nnbu yes, there is some rebase conflicts, ideally you should use |
116fcdd
to
b60551d
Compare
@RedbackThomson Will you be reviewing this PR please? It is similar to the change you did for subnet to routeTable association. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @nnbu ! Left few comments in-line
} | ||
|
||
toAdd := make([]*string, 0) | ||
toDelete := make([]*svcsdk.RouteTableAssociation, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for consistency can we make this array of string type? make([]*string, 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do that. However, I am using svcsdk.RouteTableAssociation
to print Debug message with 2 fields 1. route table id and 2. association id. *[]string
in case of toDelete would need to hold association id only.
In case of toAdd, association
is not established yet. so, there is no association id to print.
I can still make the change and remove the debug statement, because printing association id without mentioning routing table id would be not much of a use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you did there. Good points.
resp, err := rm.sdkapi.DescribeRouteTablesWithContext(ctx, input) | ||
if err != nil || resp == nil { | ||
break | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should just return an error here. The break when resp.NextToken == nil|""
is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil {
return nil, err
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not fully sure, but if resp is nil ever (without err being nil), then the for loop at line 439 would crash while dereferencing resp
.
ec2_validator.assert_internet_gateway(resource_id, exists=False) | ||
|
||
def simple_route_table(vpc_id: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did think about before copying over this function here. :)
But this one is simpler
route table that does not have additional entries associated with like. e.g. IGW_ID(internet gateway), DEST_CIDR_BLOCK among others.
It would need unnecessary functionality to create additional internet gateway while this test is testing internet gateway itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you're having a separate resource file for this function, which make things ok! Great!
/unhold |
Description of changes: New custom field RouteTables is added to internetGateway CRD. Route Table to Internet Gateway association is done using AssociateRouteTable API call and association is removed using DisassociateRouteTable API call. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
b60551d
to
ad8eef7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much sir! @nnbu
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, nnbu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue # aws-controllers-k8s/community#1892
Description of changes:
New custom field RouteTables is added to internetGateway CRD. Route Table to Internet Gateway association is done using AssociateRouteTable API call and association is removed using DisassociateRouteTable API call.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.