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

Filter dest addresses based on IngressIP #26

Merged

Conversation

sstrk
Copy link
Contributor

@sstrk sstrk commented Apr 23, 2021

The host nodes of a cluster can have IPv4 and/or IPv6 addresses.
The controller does not distinguish the address families, which leads to
the fact that all addresses will be used as Destination Addresses
independent of the preferred IPFamily of the Service or the Ingress IP.

This commit adjusts getDestinationAddress to return two lists, one for
each supported address family.
To do so, functions to check the correctness of a textual representation
of an IP and to check the address family got implemented.
golang does not natively support the determination of the address family,
which is why the presence of ":" and "." is checked.

The GenerateModel function has been adjusted to use only IP addresses
of the same address family as the IngressIP as destination addresses.

Fixes #25

@sstrk sstrk changed the title Filter dest addresses based on preferred IPFamily Filter dest addresses based on IngressIP Apr 23, 2021
@sstrk sstrk force-pushed the feature/filter-ip-address-family branch 3 times, most recently from f55dba3 to f927006 Compare April 23, 2021 09:03
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
@sstrk sstrk force-pushed the feature/filter-ip-address-family branch 3 times, most recently from 170f073 to 36dfa10 Compare April 23, 2021 11:41
internal/controller/model_nodeport.go Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
internal/controller/model_nodeport.go Outdated Show resolved Hide resolved
The host nodes of a cluster can have IPv4 and/or IPv6 addresses.
The controller does not distinguish the address families, which leads to
the fact that all addresses will be used as Destination Addresses
independent of the preferred IPFamily of the Service or the Ingress IP.

This commit adjusts getDestinationAddress to return two lists, one for
each supported address family.
To do so, functions to check the correctness of a textual representation
of an IP and to check the address family got implemented.
golang does not natively support the determination of the address family,
which is why the presence of ":" and "." is checked.

The GenerateModel function has been adjusted to use only IP addresses
of the same address family as the IngressIP as destination addresses.

Fixes cloudandheat#25
@sstrk sstrk force-pushed the feature/filter-ip-address-family branch from 36dfa10 to 692ebfe Compare April 27, 2021 10:06
@horazont horazont merged commit 81d2492 into cloudandheat:master Apr 27, 2021
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.

Bug: Controller does not filter IP address family
2 participants