Skip to content

Commit 9309384

Browse files
committed
fix: validate existing table values correctly
1 parent 2295b8d commit 9309384

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pkg/recipeutil/values.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,17 @@ func ValidateValue(validator recipe.VariableValidator, value interface{}) error
185185
validatorFunc = staticValidatorFunc
186186
}
187187

188+
columnIndex := 0
189+
for _, col := range v.Columns {
190+
if col == validator.Column {
191+
break
192+
}
193+
columnIndex++
194+
}
195+
188196
for _, row := range v.Rows {
189-
for _, cell := range row {
190-
if err := validatorFunc(cell); err != nil {
191-
return err
192-
}
197+
if err := validatorFunc(row[columnIndex]); err != nil {
198+
return err
193199
}
194200
}
195201
default:

0 commit comments

Comments
 (0)