Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKassio Borges <kassioborgesm@gmail.com>2023-04-13 23:54:00 +0300
committerKassio Borges <kassioborgesm@gmail.com>2023-04-14 10:53:42 +0300
commit0b45fb3b0528dd88cf50ed5656c15f1f7728db0a (patch)
tree980d05b98fa442ca6bb928621455c5f873d4ec2e /internal
parent1d552267c133c9275b07191c594632cb0ba9e5f9 (diff)
Remove duplicated log key
Diffstat (limited to 'internal')
-rw-r--r--internal/source/gitlab/api/lookup.go8
-rw-r--r--internal/source/gitlab/cache/retriever.go2
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)