Skip to content

Commit

Permalink
Remove Argo template UI reference to avoid UX conflicts with v2 compa…
Browse files Browse the repository at this point in the history
…tible mode (kubeflow#723)

* remove argo template reference

* address the suggestions
  • Loading branch information
Tomcli authored Sep 1, 2021
1 parent 5d3c041 commit 5daa744
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions frontend/src/lib/v2/WorkflowUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export function isArgoWorkflowTemplate(template: Workflow): boolean {
return false;
}

export function isTektonPipelineRunTemplate(template: Workflow): boolean {
if (template?.kind === 'PipelineRun' && template?.apiVersion?.startsWith('tekton.dev/')) {
return true;
}
return false;
}

// Assuming template is the JSON format of PipelineJob in api/v2alpha1/pipeline_spec.proto
// TODO(zijianjoy): We need to change `template` format to PipelineSpec once SDK support is in.
export function convertJsonToV2PipelineSpec(template: string): PipelineSpec {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/PipelineDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {
if (templateString) {
try {
const template = JsYaml.safeLoad(templateString);
if (WorkflowUtils.isArgoWorkflowTemplate(template)) {
if (WorkflowUtils.isTektonPipelineRunTemplate(template)) {
graph = StaticGraphParser.createGraph(template!);

reducedGraph = graph ? transitiveReduction(graph) : undefined;
Expand All @@ -316,8 +316,8 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {
graphV2 = convertFlowElements(pipelineSpec);
} else {
throw new Error(
'Unable to convert string response from server to Argo workflow template' +
': https://argoproj.github.io/argo-workflows/workflow-templates/',
'Unable to convert string response from server to Tekton Pipelinerun template' +
': https://tekton.dev/docs/pipelines/pipelineruns/',
);
}
} catch (err) {
Expand Down

0 comments on commit 5daa744

Please sign in to comment.