Closed Panaetius closed 1 year ago
Thanks for the report! Would throwing an error from the resource constructor would be more in line with what you'd expect?
An explicit check in the constructor to check for invalid properties would be even nicer, yes. As long as it mentions the name of the property and the name of the affected resource, i think that's the key information needed.
Thanks a lot for the quick reply and the awesome work you're doing, i really love pulumi and what it's doing!
The Python SDK includes much better type support now, so closing as fixed.
Problem description
I wanted to render a helm chart that includes the resource: https://github.com/SwissDataScienceCenter/renku-graph/blob/master/helm-chart/renku-graph/charts/jena/templates/fuseki-server.yaml
This resource definition is wrong, as
type
is not a valid property on aConfigMap
(type
is only available onSecret
). I'd expect this to produce a human readable error about there being an invalid property present, instead pulumi produces a python stack trace about an expected keyword argument (see below).Errors & Logs
Suggestions for a fix
Ideally, pulumi-kubernetes would catch these errors and produce a more human readable error message, as it takes quite a while to debug otherwise. E.g.
Invalid property 'type' present in resource 'fuseki-server-sh'
in this case.I'm not sure to what extent this affects all resources on this and the following lines in https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/python/pulumi_kubernetes/yaml.py#L187 (are resource properties verified before being passed to
_parse_yaml_object(..)
?) and if it's enough to wrap all of them in a try...catch.. around_parse_yaml_object(..)
.