@kui-shell/plugin-tekton
Version:
Visualizations for Tekton Pipelines
21 lines • 711 B
JavaScript
const tektonAPI = /tekton.dev/;
export function isTask(resource) {
return resource && tektonAPI.test(resource.apiVersion) && resource.kind === 'Task';
}
export function isPipeline(resource) {
const run = resource;
return (run &&
tektonAPI.test(run.apiVersion) &&
run.spec !== undefined &&
run.kind === 'Pipeline' &&
run.spec.tasks !== undefined);
}
export function isPipelineRun(resource) {
const run = resource;
return (tektonAPI.test(run.apiVersion) &&
run.spec !== undefined &&
run.kind === 'PipelineRun' &&
run.spec.serviceAccount !== undefined &&
run.spec.pipelineRef !== undefined);
}
//# sourceMappingURL=resource.js.map