diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2023-04-14 18:13:23 +0300 |
---|---|---|
committer | Vladimir Shushlin <vshushlin@gitlab.com> | 2023-04-14 18:13:23 +0300 |
commit | 114619b32428e0ab2377473432fdea8786f259d0 (patch) | |
tree | 5edb48bdcb4f4040c8003fb813d22628810750f3 | |
parent | 32c0b91fae31d7e2a56f77894eeccc9064309a60 (diff) | |
parent | 0b45fb3b0528dd88cf50ed5656c15f1f7728db0a (diff) |
Merge branch 'kassio/remove-duplicated-log-key' into 'master'
Remove duplicated log key
See merge request https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/865
Merged-by: Vladimir Shushlin <vshushlin@gitlab.com>
Approved-by: Naman Jagdish Gala <ngala@gitlab.com>
Approved-by: Vladimir Shushlin <vshushlin@gitlab.com>
Co-authored-by: Kassio Borges <kassioborgesm@gmail.com>
-rw-r--r-- | internal/source/gitlab/api/lookup.go | 8 | ||||
-rw-r--r-- | internal/source/gitlab/cache/retriever.go | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/internal/source/gitlab/api/lookup.go b/internal/source/gitlab/api/lookup.go index f7d8987a..3c71b37e 100644 --- a/internal/source/gitlab/api/lookup.go +++ b/internal/source/gitlab/api/lookup.go @@ -21,6 +21,14 @@ func (l *Lookup) ParseDomain(r io.Reader) { } } +func (l *Lookup) LookupPaths() []LookupPath { + if l == nil || l.Domain == nil { + return []LookupPath{} + } + + return l.Domain.LookupPaths +} + // Ensure lookupPaths are sorted by prefix length to ensure the group level // domain with prefix "/" is the last one to be checked. // See https://gitlab.com/gitlab-org/gitlab-pages/-/issues/576 diff --git a/internal/source/gitlab/cache/retriever.go b/internal/source/gitlab/cache/retriever.go index 01ce4a16..d4e26d7d 100644 --- a/internal/source/gitlab/cache/retriever.go +++ b/internal/source/gitlab/cache/retriever.go @@ -55,7 +55,7 @@ func (r *Retriever) Retrieve(correlationID, domain string) (lookup api.Lookup) { "correlation_id": correlationID, "requested_domain": domain, "lookup_name": lookup.Name, - "lookup_paths": lookup.Domain, + "lookup_paths": lookup.LookupPaths(), "lookup_error": lookup.Error, }).WithError(ctx.Err()).Debug(logMsg) |