Skip to content

Commit 438c518

Browse files
authored
Merge pull request #12 from sysdiglabs/dev-registry-repo-ann
Add Registry Repository annotation
2 parents 7b4b95f + 438d3c2 commit 438c518

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sysdig/backstage-plugin-sysdig",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"main": "dist/index.esm.js",
55
"types": "dist/index.d.ts",
66
"license": "Apache-2.0",

src/components/SysdigVMRegistryFetchComponent/SysdigVMRegistryFetchComponent.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
// annotations
2424
SYSDIG_REGISTRY_NAME_ANNOTATION,
2525
SYSDIG_REGISTRY_VENDOR_ANNOTATION,
26+
SYSDIG_REGISTRY_REPOSITORY_ANNOTATION,
2627
SYSDIG_CUSTOM_FILTER_ANNOTATION,
2728

2829
// methods
@@ -32,8 +33,7 @@ import {
3233
API_PROXY_BASE_PATH,
3334
API_VULN_REGISTRY,
3435
getBacklink
35-
} from '../../lib'
36-
36+
} from '../../lib';
3737

3838
type RegistryScan = {
3939
mainAssetName: string,
@@ -129,6 +129,11 @@ export const SysdigVMRegistryFetchComponent = () => {
129129
name = annotations[SYSDIG_REGISTRY_VENDOR_ANNOTATION]
130130
filters.push('registry.vendor="' + name + '"');
131131
}
132+
133+
if (SYSDIG_REGISTRY_REPOSITORY_ANNOTATION in annotations) {
134+
name = annotations[SYSDIG_REGISTRY_REPOSITORY_ANNOTATION]
135+
filters.push('repository.name="' + name + '"');
136+
}
132137

133138
if (filters.length == 0) {
134139
return []

src/lib/annotations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ export const SYSDIG_REGISTRY_NAME_ANNOTATION = "sysdigcloud.com/registry-name";
110110
// The registry vendor that will be included in the results. Example: "harbor"
111111
export const SYSDIG_REGISTRY_VENDOR_ANNOTATION = "sysdigcloud.com/registry-vendor";
112112

113+
// The registry repository that will be included in the results. Example: "library/nginx"
114+
export const SYSDIG_REGISTRY_REPOSITORY_ANNOTATION = "sysdigcloud.com/registry-repository";
115+
113116
/*
114117
* Pipeline
115118
*/

src/lib/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export {
2727
SYSDIG_WORKLOAD_TYPE_ANNOTATION,
2828
SYSDIG_CONTAINER_ANNOTATION,
2929
SYSDIG_REGISTRY_NAME_ANNOTATION,
30-
SYSDIG_REGISTRY_VENDOR_ANNOTATION,
30+
SYSDIG_REGISTRY_VENDOR_ANNOTATION,
31+
SYSDIG_REGISTRY_REPOSITORY_ANNOTATION,
3132
SYSDIG_IMAGE_FREETEXT_ANNOTATION,
3233
SYSDIG_CUSTOM_FILTER_ANNOTATION
3334
} from './annotations'

0 commit comments

Comments
 (0)