From 99286fac25da60a2cbd1c0ebeda0ac2fb2d4698a Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 2 Nov 2023 13:32:43 +0530 Subject: [PATCH 1/2] fix: copy namespace from scrape result to config item --- db/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/db/config.go b/db/config.go index 29ad9e99..4cc9b7b5 100644 --- a/db/config.go +++ b/db/config.go @@ -147,6 +147,7 @@ func NewConfigItemFromResult(result v1.ScrapeResult) (*models.ConfigItem, error) ConfigClass: result.ConfigClass, Type: &result.Type, Name: &result.Name, + Namespace: &result.Namespace, Source: &result.Source, Tags: &result.Tags, Config: &dataStr, From 8bdf5c088b886b6a01f34d0fa53146aa18c785a4 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 2 Nov 2023 13:52:47 +0530 Subject: [PATCH 2/2] chore: fix test fixture --- fixtures/expected/file-git.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fixtures/expected/file-git.json b/fixtures/expected/file-git.json index 99862f31..259fea05 100644 --- a/fixtures/expected/file-git.json +++ b/fixtures/expected/file-git.json @@ -61,6 +61,13 @@ "display": { "template": "code={{.code}}, age={{.sslAge}}" } + }, + { + "name": "http-headers", + "test": { + "expr": "json.headers[\"User-Agent\"].startsWith(\"canary-checker/\")" + }, + "url": "https://httpbin.demo.aws.flanksource.com/headers" } ] }