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

ec2.securitygroup: Handle nil fromPort/toPort (ipProtocol -1) #617

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

chlunde
Copy link
Collaborator

@chlunde chlunde commented Apr 8, 2021

Description of your changes

When ipProtocol is -1, fromPort/toPort will be nil. This causes a panic
when sorting ingress/egress rules. We just need a stable sort so we can
use an aws helper to get 0 for the value in that case.

Also add a normal test for the sort functions (have more than one item so we will sort something).

Fixes #616

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

When ipProtocol is -1, fromPort/toPort will be nil. This causes a panic
when sorting ingress/egress rules. We just need a stable sort so we can
use an aws helper to get 0 for the value in that case.

Fixes crossplane-contrib#616

Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no>
@muvaf
Copy link
Member

muvaf commented Apr 8, 2021

Thanks!

@muvaf muvaf merged commit 1cdb0c4 into crossplane-contrib:master Apr 8, 2021
@chlunde chlunde mentioned this pull request Aug 20, 2021
6 tasks
tektondeploy pushed a commit to gtn3010/provider-aws that referenced this pull request Mar 12, 2024
Configure and add example for ResourceAssociation resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec2.sg: panic when sorting ingress/egress rules without port (ipProtocol -1)
2 participants