Skip to content

Commit 8bc931a

Browse files
fix: update admin annotation prefix (#179)
* change admin annotation prefix * Update admin-job-annotations.yaml * Update index.test.js
1 parent 38a0345 commit 8bc931a

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ function validateReservedAnnotation(doc) {
8989
default: {}
9090
});
9191

92-
if (Object.keys(jobAnnotations).some(key => key.startsWith('screwdriver.cd/admin'))) {
93-
throw new Error('Annotations starting with screwdriver.cd/admin are reserved for system use only');
92+
if (Object.keys(jobAnnotations).some(key => key.startsWith('screwdriver.cd/sdAdmin'))) {
93+
throw new Error('Annotations starting with screwdriver.cd/sdAdmin are reserved for system use only');
9494
}
9595

9696
warnings = warnings.concat(

test/data/admin-job-annotations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
jobs:
22
main:
33
annotations:
4-
screwdriver.cd/adminA: c
4+
screwdriver.cd/sdAdminA: c
55
image: node:22
66
steps:
77
- install: npm install

test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe('config parser', () => {
330330
parser({ yaml: loadData('admin-job-annotations.yaml'), triggerFactory }).then(data => {
331331
assert.match(
332332
data.errors[0],
333-
/Error: Annotations starting with screwdriver.cd\/admin are reserved for system use only/
333+
/Error: Annotations starting with screwdriver.cd\/sdAdmin are reserved for system use only/
334334
);
335335
}));
336336

0 commit comments

Comments
 (0)