Skip to content
Permalink
Browse files
fix(post-renderer): fix null value validation panic in annotations an…
…d labels

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed May 23, 2022
1 parent 4cf589c commit 5d80460a3bf3d86927dde49535b10eb1a3492c1b
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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
}

0 comments on commit 5d80460

Please sign in to comment.