spec.owner added into template schema

Signed-off-by: Victor Perera <v-vperera@expediagroup.com>
This commit is contained in:
Victor Perera
2021-05-05 14:46:13 -05:00
parent 4c7aaf36f3
commit a23850d4ad
10 changed files with 109 additions and 6 deletions
@@ -91,4 +91,8 @@ describe('templateEntityV1alpha1Validator', () => {
(entity as any).spec.templater = '';
await expect(validator.check(entity)).rejects.toThrow(/templater/);
});
it('accepts missing owner', async () => {
delete (entity as any).spec.owner;
await expect(validator.check(entity)).resolves.toBe(true);
});
});
@@ -33,7 +33,7 @@ export interface TemplateEntityV1alpha1 extends Entity {
templater: string;
path?: string;
schema: JSONSchema;
owner: string;
owner?: string;
};
}
@@ -59,6 +59,7 @@ describe('templateEntityV1beta2Validator', () => {
output: {
fetchUrl: '{{ steps.fetch.output.targetUrl }}',
},
owner: 'example@email.com',
},
};
});
@@ -121,4 +122,8 @@ describe('templateEntityV1beta2Validator', () => {
delete (entity as any).spec.steps[0].action;
await expect(validator.check(entity)).rejects.toThrow(/action/);
});
it('accepts missing owner', async () => {
delete (entity as any).spec.owner;
await expect(validator.check(entity)).resolves.toBe(true);
});
});
@@ -41,6 +41,7 @@ export interface TemplateEntityV1beta2 extends Entity {
parameters?: JsonObject;
}>;
output?: { [name: string]: string };
owner?: string;
};
}
@@ -85,6 +85,10 @@
"schema": {
"type": "object",
"description": "The JSONSchema describing the inputs for the template."
},
"owner": {
"type": "string",
"description": "The user (or group) owner of the template"
}
}
}
@@ -168,6 +168,10 @@
"additionalProperties": {
"type": "string"
}
},
"owner": {
"type": "string",
"description": "The user (or group) owner of the template"
}
}
}