diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index 85c78191d30..734e5335d8e 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -296,6 +296,8 @@ spec: value: $(context.pipeline.name) - name: contextRetriesParam value: $(context.pipelineTask.retries) + - name: param-not-found + value: $(params.notfound) retries: 5 taskRef: name: unit-test-task @@ -385,6 +387,8 @@ spec: value: test-pipeline - name: contextRetriesParam value: "5" + - name: param-not-found + value: $(params.notfound) retries: 5 serviceAccountName: test-sa taskRef: diff --git a/pkg/reconciler/pipelinerun/resources/apply.go b/pkg/reconciler/pipelinerun/resources/apply.go index b76361b19c9..796baf206e3 100644 --- a/pkg/reconciler/pipelinerun/resources/apply.go +++ b/pkg/reconciler/pipelinerun/resources/apply.go @@ -160,7 +160,7 @@ func filterMatrixContextVar(params v1.Params) v1.Params { // tasks..matrix.length // tasks..matrix..length subExpressions := strings.Split(expression, ".") - if subExpressions[2] == "matrix" && subExpressions[len(subExpressions)-1] == "length" { + if len(subExpressions) >= 4 && subExpressions[2] == "matrix" && subExpressions[len(subExpressions)-1] == "length" { filteredParams = append(filteredParams, param) } }