Handle Pool.resolved to use external hostname
This commit is contained in:
parent
c1d8233339
commit
b61906c32f
|
@ -176,7 +176,7 @@ public extension ProviderConnectionProfile {
|
|||
|
||||
var addresses: [String] {
|
||||
var addrs = pool?.addresses() ?? []
|
||||
if let pool = pool, let externalHostname = try? preset?.externalConfiguration(forKey: .hostname, infrastructureName: infrastructure.name, pool: pool) as? String {
|
||||
if addrs.isEmpty, let pool = pool, !(pool.isResolved ?? false), let externalHostname = try? preset?.externalConfiguration(forKey: .hostname, infrastructureName: infrastructure.name, pool: pool) as? String {
|
||||
addrs.insert(externalHostname, at: 0)
|
||||
}
|
||||
return addrs
|
||||
|
|
|
@ -44,6 +44,8 @@ public struct Pool: Codable, Hashable {
|
|||
|
||||
case hostname
|
||||
|
||||
case isResolved = "resolved"
|
||||
|
||||
case numericAddresses = "addrs"
|
||||
}
|
||||
|
||||
|
@ -62,6 +64,8 @@ public struct Pool: Codable, Hashable {
|
|||
// public let location: (Double, Double)
|
||||
|
||||
public let hostname: String?
|
||||
|
||||
public let isResolved: Bool?
|
||||
|
||||
public let numericAddresses: [UInt32]?
|
||||
|
||||
|
|
Loading…
Reference in New Issue