Skip to content

Conversation

@FactorT
Copy link
Contributor

@FactorT FactorT commented Jan 16, 2023

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

@pashagolub pashagolub self-assigned this Jan 16, 2023
@pashagolub pashagolub added the bug label Jan 16, 2023
@pashagolub pashagolub changed the title fix VIP address lookup in IP address list [-] fix VIP address lookup in IP address list, fixes #125 Jan 16, 2023
@pashagolub
Copy link
Collaborator

Thanks.

@pashagolub pashagolub merged commit aab520a into cybertec-postgresql:master Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vip-manager recognizes wrong state

2 participants