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 workspace types for Task and TaskRun with validation #1639

Merged
merged 1 commit into from
Dec 17, 2019

Commits on Dec 17, 2019

  1. Add workspace types for Task and TaskRun with validation

    This allows users to use Volumes with Tasks such that:
    - The actual volumes to use (or subdirectories on those volumes) are
      provided at runtime, not at Task authoring time
    - At Task authoring time you can declare that you expect a volume to
      be provided and control what path that volume should end up at
    - Validation will be provided that the volumes (workspaces) are actually
      provided at runtime
    
    Before this change, there were two ways to use Volumes with Tasks:
    - VolumeMounts were explicitly declared at the level of a step
    - Volumes were declared in Tasks, meaning the Task author controlled the
      name of the volume being used and it wasn't possible at runtime to use
      a subdir of the volume
    - Or the Volume could be provided via the podTemplate, if the user
      realized this was possible
    
    None of this was validated and could cause unexpected and hard to
    diagnose errors at runtime.
    
    It's possible folks might be specifying volumes already in the Task or
    via the stepTemplate that might collide with the names we are using for
    the workspaces; instead of validating this and making the Task author
    change these, we can instead randomize them!
    
    We have also limited (at least initially) the types of volume source
    being supported instead of expanding to all volume sources, tho we can
    expand it later if we want to and if users need it. This would reduce
    the API surface that a Tekton compliant system would need to conform to
    (once we actually define what conformance means!).
    
    Part of tektoncd#1438
    
    In future commits we will add support for workspaces to Pipelines and
    PipelineRuns as well; for now if a user tries to use a Pipeline with a
    Task that requires a Workspace, it will fail at runtime because it is
    not (yet) possible for the Pipeline and PipelineRun to provide
    workspaces.
    
    Co-authored-by: Scott <sbws@google.com>
    bobcatfish and Scott committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    eb23ad7 View commit details
    Browse the repository at this point in the history