mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-23 11:39:32 +02:00
controlplane: only enable STATIC dns when all adresses are IP addresses (#1822)
This commit is contained in:
parent
979e8f9cec
commit
bcc8c17855
2 changed files with 27 additions and 7 deletions
|
@ -292,13 +292,13 @@ func buildCluster(
|
|||
}
|
||||
|
||||
// for IPs we use a static discovery type, otherwise we use DNS
|
||||
isIP := false
|
||||
allIP := true
|
||||
for _, lbe := range lbEndpoints {
|
||||
if net.ParseIP(urlutil.StripPort(lbe.GetEndpoint().GetAddress().GetSocketAddress().GetAddress())) != nil {
|
||||
isIP = true
|
||||
if net.ParseIP(urlutil.StripPort(lbe.GetEndpoint().GetAddress().GetSocketAddress().GetAddress())) == nil {
|
||||
allIP = false
|
||||
}
|
||||
}
|
||||
if isIP {
|
||||
if allIP {
|
||||
cluster.ClusterDiscoveryType = &envoy_config_cluster_v3.Cluster_Type{Type: envoy_config_cluster_v3.Cluster_STATIC}
|
||||
} else {
|
||||
cluster.ClusterDiscoveryType = &envoy_config_cluster_v3.Cluster_Type{Type: envoy_config_cluster_v3.Cluster_STRICT_DNS}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue