report: move synthetic ALIAS hop from collector to report view
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
52a3e56c4f
commit
1493ef4d3f
2 changed files with 10 additions and 8 deletions
|
|
@ -400,12 +400,6 @@ func observeApex(ctx context.Context, data *AliasData, servers []string, apex st
|
||||||
|
|
||||||
if (hasA || hasAAAA) && !data.ApexHasCNAME {
|
if (hasA || hasAAAA) && !data.ApexHasCNAME {
|
||||||
data.ApexFlattening = true
|
data.ApexFlattening = true
|
||||||
// Synthesize a pseudo-hop so the report's chain view shows the ALIAS
|
|
||||||
// indirection that would otherwise be invisible from the wire.
|
|
||||||
data.Chain = append(data.Chain, ChainHop{
|
|
||||||
Owner: lowerFQDN(apex),
|
|
||||||
Kind: KindALIAS,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,15 @@ func buildReportView(data *AliasData, states []sdk.CheckState) *reportView {
|
||||||
v.FinalAddresses = append(v.FinalAddresses, data.FinalA...)
|
v.FinalAddresses = append(v.FinalAddresses, data.FinalA...)
|
||||||
v.FinalAddresses = append(v.FinalAddresses, data.FinalAAAA...)
|
v.FinalAddresses = append(v.FinalAddresses, data.FinalAAAA...)
|
||||||
|
|
||||||
for i, h := range data.Chain {
|
chain := data.Chain
|
||||||
|
if data.ApexFlattening {
|
||||||
|
chain = append(chain, ChainHop{
|
||||||
|
Owner: data.Apex,
|
||||||
|
Kind: KindALIAS,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, h := range chain {
|
||||||
step := chainStep{
|
step := chainStep{
|
||||||
Index: i + 1,
|
Index: i + 1,
|
||||||
Owner: h.Owner,
|
Owner: h.Owner,
|
||||||
|
|
@ -112,7 +120,7 @@ func buildReportView(data *AliasData, states []sdk.CheckState) *reportView {
|
||||||
Target: h.Target,
|
Target: h.Target,
|
||||||
TTL: h.TTL,
|
TTL: h.TTL,
|
||||||
Server: h.Server,
|
Server: h.Server,
|
||||||
IsLast: i == len(data.Chain)-1,
|
IsLast: i == len(chain)-1,
|
||||||
}
|
}
|
||||||
switch h.Kind {
|
switch h.Kind {
|
||||||
case KindCNAME:
|
case KindCNAME:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue