tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.48k stars 1.78k forks source link

Improve Validation for a PipelineTask Spec Error Type #6945

Open EmmaMunley opened 1 year ago

EmmaMunley commented 1 year ago

Expected Behavior

The following would say something like "pt2-with-result" has an unknown field type. Only name and value can be defined in the Pipelinetask.

- name: pt2-with-result
      params:
        - name: versions
           type: array

Actual Behavior

Current Error returned: Error calling MarshalJSON for type v1.ParamValue: impossible ParamValues.Type: ""

Steps to Reproduce the Problem

Pipeline Spec

`metadata:
  name: %s
  namespace: %s
spec:
  tasks:
    - name: pt1-with-result
      params:
        - name: GOARCHs
          type: array
      taskRef:
        name: task1withresults
        kind: Task
    - name: pt2-with-result
      params:
        - name: versions
          type: array
      taskRef:
        name: task2withresults
        kind: Task

Additional Info

Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:36:36Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"darwin/arm64"}
Client version: 0.31.1
Pipeline version: devel
tekton-robot commented 1 year ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.