Open jkhelil opened 2 months ago
cc @chitrangpatel
The way it was designed was such that for an inlined Step
, you don't need step results
since an inlined Step is in the direct body (i.e. not referenced) of the Task so what you need is a Result
.
Step Results
were introduced so that StepActions
(which are always referenced in some Task
) have a way of declaring and robustly using results
without fear of name clashes and overwriting etc.
In your example, I think you want to support both Result
and a Step Result
in an inlined Step
which is a bit counter intuitive to me. Why not simply use Result
?
Hi!
My example was a bit simplified.
But my scenario is:
PipelineRun
referencing a Pipeline
via a git ref Pipeline
using 2 tasks via git ref
collect-data
and apply-data
collect-data
has 3 steps:
StepAction
via a git refStepAction
accepts parameters using results from the preceeding step.apply-data
also accepts parameters with results determined within collect-data
I crafted a reproducer here: https://github.com/scoheb/test-stepactions/tree/main/git-referenced
if you have any recommendations, please let me know!
thanks!
Ah I see. So you want to pass a param value which is a result of a previous step. There is no way to reference the Task result in another step. That is only possible in another Task within a pipeline.
I'm in agreement in that case that this should be supported.
When defining a Tekton Task that utilizes both spec.results and spec.steps[].results, the Task fails with a validation error. Specifically, the error indicates that the variables defined in spec.steps[].results cannot be accessed correctly within the step scripts, leading to a validation failure.
Error from server (BadRequest): error when creating "step-action.yaml": admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: non-existent variable in "#!/usr/bin/env sh\nset -x\nSINGLE_COMPONENT_MODE=\"scott\"\n\necho -n \"${SINGLE_COMPONENT_MODE}\" > $(step.results.singleComponentMode.path)\necho -n \"tom\" > $(results.resultsDir.path)\n": spec.steps[0].script
Expected Behavior
spec.results and spec.steps[].results working togother
Actual Behavior
spec.results and spec.steps[].results doesnt seem to work when used togother
Steps to Reproduce the Problem
create the task and taskrun as the followin
apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: my-stepaction spec: params:
!/usr/bin/env bash
echo ${SINGLE_COMPONENT}
apiVersion: tekton.dev/v1 kind: TaskRun metadata: generateName: test- spec: taskRef: name: collect-data
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'