Skip to content

Commit

Permalink
fix: validate existing table values correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Oct 4, 2024
1 parent 2295b8d commit 9309384
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/recipeutil/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,17 @@ func ValidateValue(validator recipe.VariableValidator, value interface{}) error
validatorFunc = staticValidatorFunc
}

columnIndex := 0
for _, col := range v.Columns {
if col == validator.Column {
break
}
columnIndex++
}

for _, row := range v.Rows {
for _, cell := range row {
if err := validatorFunc(cell); err != nil {
return err
}
if err := validatorFunc(row[columnIndex]); err != nil {
return err
}
}
default:
Expand Down

0 comments on commit 9309384

Please sign in to comment.