-
Notifications
You must be signed in to change notification settings - Fork 4
OPS-2581 Correcting dup subnets logic #6
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
base: master
Are you sure you want to change the base?
Conversation
| - "{{ aws_vpc_rt_subnet_by_cidr }}" | ||
| - "{{ aws_vpc_rt_subnet_by_filter }}" | ||
| - "{{ aws_vpc_rt_subnet_by_id }}" | ||
| when: not ([item] in aws_vpc_route_table_subnets) |
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'd say we should assert here and error out in order to make the user aware of the fact that two duplicate subnets have been found.
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.
Is that really an error? Could we not in theory have two subnets with duplicated facts but in different fields? If it is, then I would agree, but it sounds to me that it might not be in all cases.
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.
In particular, maybe two subnets with the same tags?
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.
It is search by filter. So you could for example only specify tag:department=DevOps which would return a lot of subnets which all have this tag attached.
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.
Well, then the question is whether or not we would have some sort of logic to detect when filters are given which return too many subnets? Perhaps a ticket should be opened to deal with this later on? For now the change I made will keep duplicate subnets from being added to the route table subnet list.
cytopia
left a comment
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.
what do u think?
Modified code to add a when statement that will not add a subnet to the returned list if it is already there.