Skip to content

Commit

Permalink
fix(post-renderer): fix null value validation panic in annotations an…
Browse files Browse the repository at this point in the history
…d labels

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed May 23, 2022
1 parent 4cf589c commit 5d80460
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -147,7 +147,12 @@ func validateStringNode(node *yaml_v3.Node) error {
return fmt.Errorf("unable to decode value %q: %w", node.Value, err)
}
if _, ok := v.(string); !ok {
return fmt.Errorf("invalid node %q: expected string, got %s", node.Value, reflect.TypeOf(v).String())
typeOf := reflect.TypeOf(v)
if typeOf != nil {
return fmt.Errorf("invalid node %q: expected string, got %s", node.Value, reflect.TypeOf(v).String())
} else {
return fmt.Errorf("invalid node %q: expected string, got null value", node.Value)
}
}
return nil
}
Expand Down

0 comments on commit 5d80460

Please sign in to comment.