[-] fix VIP address lookup in IP address list, fixes #125 #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #125 issue
c.VIP.String() - VIP address without netmask.
c.getCIDR() - VIP address with netmask.
When VIP address is a substring of server's IP address, the vip-manager doesn't rise VIP address because conditions "if strings.Contains(address.String(), c.VIP.String())" returns true. And vip-manager thinks that VIP adress is already up.
For example:
VIP = 192.168.1.2, server's IP = 192.168.1.210
condition "if strings.Contains(address.String(), c.VIP.String())" will return true because 192.168.1.2 is substring of 19.168.1.210
But address.String() has format like ip_address/netmaks (192.168.1.210/24)
And we have to compare it with VIP adress plus netmask too
And for VIP address we have to use c.getCIDR() that returns vip address with netmask