Skip to content

Commit

Permalink
Fix merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
othomann committed Apr 2, 2020
1 parent 989338d commit c472c8a
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions pkg/apis/pipeline/v1beta1/param_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,9 @@ var variableSubstitutionRegex = regexp.MustCompile(variableSubstitutionFormat)
// NewResultRefs extracts all ResultReferences from a param or a pipeline result.
// If the ResultReference can be extracted, they are returned. Otherwise an error is returned
func NewResultRefs(obj interface{}) ([]*ResultRef, error) {
var substitutionExpressions []string
var ok bool
switch t := obj.(type) {
case Param:
if t.Value.Type != ParamTypeString {
return nil, fmt.Errorf("Invalid result reference expression: must contain variable substitution %q", resultExpressionFormat)
}
substitutionExpressions, ok = getVarSubstitutionExpressions(t.Value.StringVal)
if !ok {
return nil, fmt.Errorf("Invalid result reference expression: must contain variable substitution %q", resultExpressionFormat)
}
case PipelineResult:
substitutionExpressions, ok = getVarSubstitutionExpressions(t.Value)
if !ok {
return nil, fmt.Errorf("Invalid result reference expression: must contain variable substitution %q", resultExpressionFormat)
}
substitutionExpressions, ok := getVarSubstitutionExpressions(obj)
if !ok {
return nil, fmt.Errorf("Invalid result reference expression: must contain variable substitution %q", resultExpressionFormat)
}
var resultRefs []*ResultRef
for _, expression := range substitutionExpressions {
Expand Down

0 comments on commit c472c8a

Please sign in to comment.