From 0b887c9aa919993aa04f509d1a3a30e4fcc63b5a Mon Sep 17 00:00:00 2001 From: Jujuyeh Date: Tue, 19 Nov 2024 17:09:01 +0100 Subject: [PATCH 1/2] Add Registry Freetext annotation --- .../SysdigVMRegistryFetchComponent.tsx | 6 ++++++ src/lib/annotations.ts | 10 ++++++++++ src/lib/index.ts | 1 + 3 files changed, 17 insertions(+) diff --git a/src/components/SysdigVMRegistryFetchComponent/SysdigVMRegistryFetchComponent.tsx b/src/components/SysdigVMRegistryFetchComponent/SysdigVMRegistryFetchComponent.tsx index dea47f7..288b5bc 100644 --- a/src/components/SysdigVMRegistryFetchComponent/SysdigVMRegistryFetchComponent.tsx +++ b/src/components/SysdigVMRegistryFetchComponent/SysdigVMRegistryFetchComponent.tsx @@ -24,6 +24,7 @@ import { SYSDIG_REGISTRY_NAME_ANNOTATION, SYSDIG_REGISTRY_VENDOR_ANNOTATION, SYSDIG_REGISTRY_REPOSITORY_ANNOTATION, + SYSDIG_REGISTRY_FREETEXT_ANNOTATION, SYSDIG_CUSTOM_FILTER_ANNOTATION, // methods @@ -131,6 +132,11 @@ export const SysdigVMRegistryFetchComponent = () => { name = annotations[SYSDIG_REGISTRY_REPOSITORY_ANNOTATION] filters.push('repository.name="' + name + '"'); } + + if (SYSDIG_REGISTRY_FREETEXT_ANNOTATION in annotations) { + name = annotations[SYSDIG_REGISTRY_REPOSITORY_ANNOTATION] + filters.push('freeText in ("' + name + '")'); + } if (filters.length == 0) { return [] diff --git a/src/lib/annotations.ts b/src/lib/annotations.ts index c726ae8..10a3861 100644 --- a/src/lib/annotations.ts +++ b/src/lib/annotations.ts @@ -104,15 +104,25 @@ export const SYSDIG_CONTAINER_ANNOTATION = "sysdigcloud.com/kubernetes-container * Registry */ +// DEPRECATION NOTICE: The following annotation is deprecated and will be removed in a future release. +// - Use SYSDIG_REGISTRY_FREETEXT_ANNOTATION instead. // The registry name that will be included in the results. Example: "registry-harbor-registry.registry.svc.cluster.local:5443" export const SYSDIG_REGISTRY_NAME_ANNOTATION = "sysdigcloud.com/registry-name"; +// DEPRECATION NOTICE: The following annotation is deprecated and will be removed in a future release. +// - Use SYSDIG_REGISTRY_FREETEXT_ANNOTATION instead. // The registry vendor that will be included in the results. Example: "harbor" export const SYSDIG_REGISTRY_VENDOR_ANNOTATION = "sysdigcloud.com/registry-vendor"; +// DEPRECATION NOTICE: The following annotation is deprecated and will be removed in a future release. +// - Use SYSDIG_REGISTRY_FREETEXT_ANNOTATION instead. // The registry repository that will be included in the results. Example: "library/nginx" export const SYSDIG_REGISTRY_REPOSITORY_ANNOTATION = "sysdigcloud.com/registry-repository"; +// Free text search to match an image or set of images. +// Examples: "quay.io", "library/nginx", ":latest" +export const SYSDIG_REGISTRY_FREETEXT_ANNOTATION = "sysdigcloud.com/registry-freetext"; + /* * Pipeline */ diff --git a/src/lib/index.ts b/src/lib/index.ts index b64c6f2..b4b41ae 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -29,6 +29,7 @@ export { SYSDIG_REGISTRY_NAME_ANNOTATION, SYSDIG_REGISTRY_VENDOR_ANNOTATION, SYSDIG_REGISTRY_REPOSITORY_ANNOTATION, + SYSDIG_REGISTRY_FREETEXT_ANNOTATION, SYSDIG_IMAGE_FREETEXT_ANNOTATION, SYSDIG_CUSTOM_FILTER_ANNOTATION } from './annotations' From 3e2b618683841c118ca5a035cf08aade8d52e866 Mon Sep 17 00:00:00 2001 From: Jujuyeh Date: Tue, 19 Nov 2024 17:10:08 +0100 Subject: [PATCH 2/2] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db7e28c..c444d0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sysdig/backstage-plugin-sysdig", - "version": "1.3.2", + "version": "1.4.0", "main": "dist/index.esm.js", "types": "dist/index.d.ts", "license": "Apache-2.0",