Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation on Pipeline creation for DAG #559

Closed
bobcatfish opened this issue Feb 27, 2019 · 1 comment
Closed

Add validation on Pipeline creation for DAG #559

bobcatfish opened this issue Feb 27, 2019 · 1 comment

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

In #168 we add DAG based execution for Pipelines instead of executing Tasks in the order they are declared.

The DAG is created based on the from and runAfter clauses. It is possible that these can be used to create Graphs which cannot actually execute and complete, e.g. infinite loops, etc.

If a user tries to create a Pipeline which contains an invalid graph, the creation should immediately fail with an informative error.

Actual Behavior

  • The logic in pkg/reconciler/v1alpha1/pipeline/resources/dag.go to traverse the DAG does some validation, but only at runtime.
  • The validateFrom function will validate the from clause, but it does not assume a graph, and it doesn't validate the runAfter clause at all.

Steps to Reproduce the Problem

  1. Create a graph with an unresolvable loop, e.g.:
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: demo-pipeline
spec:
  tasks:
  - name: some-task-1
    taskRef:
      name: some-task
    runAfter:[ some-task-2 ]
  tasks:
  - name: some-task-2
    taskRef:
      name: some-task
    runAfter:[ some-task-1 ]
  1. Note that there is no error at creation time
  2. If you create PipelineRun that tries to use this Pipeline, you should get an error

(Note this is not the only invalid Pipeline, part of the work in this issue to find all the cases to cover)

Additional Info

At the time of this issue creation, #473 which implements the graph is still being reviewed (not merged yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants