Skip to content

Commit eaa8dc6

Browse files
committed
suggestion fix
Signed-off-by: Tom <[email protected]>
1 parent 3aeaccb commit eaa8dc6

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

docs/proposal/dual_engine_dns.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion
7777
and make progress.
7878
-->
7979

80+
This KEP does not aim to implement or provide a DNS proxy or DNS server functionality. Specifically, we do not support resolving DNS names on behalf of client workloads. As a result, if a `ServiceEntry` uses a non-resolvable or fake DNS domain, client workloads may fail to resolve and access the intended service. Handling such DNS resolution scenarios is explicitly out of scope for this proposal.
81+
8082
### Proposal
8183

8284
<!--
@@ -107,8 +109,10 @@ type dnsController struct {
107109
cache cache.WorkloadCache
108110
dnsResolver *dns.DNSResolver
109111
// store the copy of pendingResolveWorkload.
112+
// key is the domain name, value is the pendingResolveDomain which contains workloads and refresh rate
110113
workloadCache map[string]*pendingResolveDomain
111114
// store all pending hostnames in the workloads
115+
// key is the workload name, value is the list of related hostnames
112116
pendingHostnames map[string][]string
113117
sync.RWMutex
114118
}
@@ -175,25 +179,9 @@ func (p *Processor) handleServicesAndWorkloads(services []*workloadapi.Service,
175179
if p.DnsResolverChan != nil {
176180
p.DnsResolverChan <- workloads
177181
}
178-
go func() {
179-
maxRetries := 50
180-
var address [][]byte
181-
for range maxRetries {
182-
workload := p.WorkloadCache.GetWorkloadByUid(uid)
183-
if address = workload.GetAddresses(); address != nil {
184-
break
185-
} else {
186-
time.Sleep(WorkloadDnsRefreshRate)
187-
}
188-
}
189-
if address != nil {
190-
log.Infof("workload: %s/%s addresses resolved: %v", workload.Namespace, workload.Name, address)
191-
if err := p.handleWorkload(workload); err != nil {
192-
log.Errorf("handle workload %s failed, err: %v", workload.ResourceName(), err)
193-
}
194-
} else {
195-
log.Warnf("workload: %s/%s addresses is still nil after %d retries, skipping", workload.Namespace, workload.Name, maxRetries)
196-
}
182+
// send the workload to dnsController for DNS resolution
183+
...
184+
// get resolved addresses from dnsController
197185
}()
198186
// wait for the service entry to be resolved
199187
}

0 commit comments

Comments
 (0)