Skip to content

Commit

Permalink
fix: revert constant ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzzzzzzz committed May 7, 2024
1 parent e684c6d commit 41ea597
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1/task_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
"github.com/tektoncd/pipeline/pkg/apis/validate"
"github.com/tektoncd/pipeline/pkg/internal/resultref"
"github.com/tektoncd/pipeline/pkg/pod"
"github.com/tektoncd/pipeline/pkg/substitution"

"golang.org/x/exp/slices"
Expand Down Expand Up @@ -313,7 +312,7 @@ func errorIfStepResultReferenceinField(value, fieldName string) (errs *apis.Fiel
}

func stepArtifactReferenceExists(src string) bool {
return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+pod.StepArtifactPathPattern+")")
return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$(step.artifacts.path)")
}
func errorIfStepArtifactReferencedInField(value, fieldName string) (errs *apis.FieldError) {
if stepArtifactReferenceExists(value) {
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1beta1/task_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
"github.com/tektoncd/pipeline/pkg/apis/validate"
"github.com/tektoncd/pipeline/pkg/internal/resultref"
"github.com/tektoncd/pipeline/pkg/pod"
"github.com/tektoncd/pipeline/pkg/substitution"

"golang.org/x/exp/slices"
Expand Down Expand Up @@ -302,7 +301,7 @@ func errorIfStepResultReferenceinField(value, fieldName string) (errs *apis.Fiel
}

func stepArtifactReferenceExists(src string) bool {
return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+pod.StepArtifactPathPattern+")")
return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$(step.artifacts.path)")
}

func errorIfStepArtifactReferencedInField(value, fieldName string) (errs *apis.FieldError) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/entrypoint/entrypointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func readArtifacts(fp string) ([]result.RunResult, error) {
if err != nil {
return nil, err
}
return []result.RunResult{{Key: fp, Value: string(file), ResultType: result.StepResultType}}, nil
return []result.RunResult{{Key: fp, Value: string(file), ResultType: result.StepArtifactsResultType}}, nil
}

func (e Entrypointer) readResultsFromDisk(ctx context.Context, resultDir string, resultType result.ResultType) error {
Expand Down

0 comments on commit 41ea597

Please sign in to comment.