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

Pipeline Service should be able to handle params #81

Closed
emmjohnson opened this issue Sep 8, 2021 · 4 comments · Fixed by #134
Closed

Pipeline Service should be able to handle params #81

emmjohnson opened this issue Sep 8, 2021 · 4 comments · Fixed by #134
Assignees
Labels
Milestone

Comments

@emmjohnson
Copy link
Contributor

emmjohnson commented Sep 8, 2021

As an operator, I want to be able to write values into the pipeline which are picked up by the runTemplate.

AC

Given a pipeline, CRD
When a value is written into the inputs field
And the runTemplate refers to that field
Then the object is stamped out with value in that field defined.
apiVersion: kontinue.io/v1alpha1
kind: Pipeline
metadata:
  name: tests
spec:
  runTemplateName: tekton-runner # use the `RunTemplate` named ‘tekton-runner’ to
                                 # figure out how to stamp out “*Run” objects that
                                 # represents “running” (e.g. tekton/PipelineRun)

  inputs:                        # at the moment, you can pass anything to this field,
    url: http://git.dev/d3adb33f.tgz     # but it could (should?) be something
                                         # strongly typed

---

apiVersion: kontinue.io/v1alpha1
kind: RunTemplate
metadata:
  name: run-with-source
  labels:
    app.tanzu.vmware.com/type: test 
spec:
  completion:
    succeeded: {key: 'status.conditions.#(type=="Succeeded").status', value: "True"}
    Failed: {key: 'status.conditions.#(type=="Succeeded").status', valueNot: "True"}

  template:
    pipelineRef: 
      name: my-tekton-pipeline                   # <= (1)
    workspaces:
      - name: shared-data
        volumeClaimTemplate:
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 5Gi
    params:
      - name: blob-url
        value: '$(pipeline.spec.inputs.url)'    # <= (2)

would result in an object

spec:
  workspaces:
    - name: shared-data
      volumeClaimTemplate:
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 5Gi
  params:
    - name: blob-url
      value: http://git.dev/d3adb33f.tgz

Notes:

The top level field should be called Inputs. This field should be a map[string]JSONobject.

Out of scope

Default values

@emmjohnson emmjohnson added this to the Beta milestone Sep 8, 2021
@DanieldeR
Copy link
Contributor

DanieldeR commented Sep 10, 2021

@squeedee
Copy link
Member

Can we be clear that this story introduces Inputs and Params or add an 'Inputs' story?

@emmjohnson emmjohnson self-assigned this Sep 16, 2021
@emmjohnson emmjohnson removed their assignment Sep 17, 2021
@emmjohnson
Copy link
Contributor Author

I wrote a kuttl test here - 81-pipeline-params, but have not had time to make it any further. Putting this back in To Do in case someone can pick it up.

@squeedee squeedee self-assigned this Sep 17, 2021
@waciumawanjohi
Copy link
Contributor

81-pipeline-params includes implementation of Input with a specified field named params. This is not required by the story, and users will be empowered to choose their own field names if we remove this params field in favor of a map[string]JOSNobject

waciumawanjohi added a commit that referenced this issue Sep 20, 2021
[#81]

Authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
@emmjohnson emmjohnson assigned tbr11 and waciumawanjohi and unassigned squeedee Sep 21, 2021
waciumawanjohi added a commit that referenced this issue Sep 21, 2021
[#81]

Authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
waciumawanjohi added a commit that referenced this issue Sep 21, 2021
[#81]

Authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
waciumawanjohi added a commit that referenced this issue Sep 21, 2021
[#81]

Authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
waciumawanjohi added a commit that referenced this issue Sep 22, 2021
Co-authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
Co-authored-by: Todd Ritchie <tritchie@vmware.com>

[#81]
waciumawanjohi added a commit that referenced this issue Sep 22, 2021
Co-authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
Co-authored-by: Todd Ritchie <tritchie@vmware.com>

[#81]
cirocosta pushed a commit that referenced this issue Sep 22, 2021
Co-authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io>
Co-authored-by: Todd Ritchie <tritchie@vmware.com>

[#81]
@cirocosta cirocosta linked a pull request Sep 24, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants