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 strong typing for PipelineResources #1282

Closed
bobcatfish opened this issue Sep 6, 2019 · 3 comments
Closed

Add strong typing for PipelineResources #1282

bobcatfish opened this issue Sep 6, 2019 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

PipelineResources should be able to define their params in their spec with types, just like other CRDs, instead of being limited to just key/value. For example:

apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
  name: my-foo
spec:
  type: foo 
  url: https://github.com/vdemeester/foo.git
  banana: coffee

(@vdemeester @pmorie I'm assuming we can't get around keeping the type field if we want to add this in a backward compatible manner?)

Actual Behavior

The current model of PipelineResource is a type (string) and a list of params (key:string, value:string). This has some limitations:

  • There is no way for a consumer of the api, to know what params should be there for a given type (as opposed to an actual type where these would be fields).
  • Complex types used to configure resources must be projected onto a set of key-value pairs
    It is not well defined how existing parameter API would be compatible with API conversions
  • Users of k8s expect conversion behavior from first-class APIs, but not from key-value pairs (as resource parameters are currently defined)

The above example PipelineResource would today need to be:

apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
  name: my-foo
spec:
  type: git
  params:
    - name: url
      value: https://github.com/vdemeester/foo.git
    - name: banana
      value: coffee

Additional Info

This must first be implemented in a backwards compatible way, which would mean supporting both the key/value fields and the new typed fields for one release.

(Most of this content comes from #238 and is @vdemeester / @pmorie 's words :D)

@bobcatfish bobcatfish added this to the Pipelines 0.8 🐱 milestone Sep 6, 2019
@pmorie
Copy link
Contributor

pmorie commented Sep 10, 2019

I'm wondering if we should make any changes here before we agree on the extension model. If we have agreement on the goal state first, we can avoid multiple API changes for users. Also, is backward compatibility important here? If so we should take that into account in the resource extension design.

@bobcatfish bobcatfish removed this from the Pipelines 0.8 🐱 milestone Oct 3, 2019
@dibyom
Copy link
Member

dibyom commented Dec 3, 2019

The new pipeline resources design can help here: #1673 ?

@dibyom dibyom closed this as completed Dec 3, 2019
@ghost ghost mentioned this issue Dec 3, 2019
@dibyom dibyom reopened this Dec 3, 2019
@ghost ghost added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 5, 2019
@bobcatfish
Copy link
Collaborator Author

Since we're completely revisiting PipelineResources via #1673 I'm going to close this but plz re-open if you want to discuss more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants