-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type assertion error with bool keys #91
Comments
Note that this is a completely valid YAML file, although not a Kubernetes yaml |
Thanks for reporting. Could you include the output you see and an example kubernetes config that triggers it? I can add that to the acceptance tests which makes fixing easier. |
The error I get is |
So it's not that it's a kubernetes config, but the way the My fix in the meantime was to just have my own struct look for the |
@garethr Any update on this issue? I'm revisiting an old product I wrote and wanted to use this but need this issue resolved first. |
In case anyone else is having this issue, the way I'm working around it is to just recover from the panic and warn the user that it recovered from a panic 🤷♂️ defer func() {
if r := recover(); r != nil {
logger.Warn("Recovered from panic while validating file: " + path)
}
}()
results, err := kubeval.Validate(fileContents, path)
... |
This is also the same issue as #98, that one has an int rather than a bool. |
This resolves instrumenta#91 and instrumenta#98
In the following yaml, when kubeval goes over it, there's a type assertion error in the
utils.go
for a boolean value. This causes a panic, and therefore should be fixed instead of ending the execution of whatever program is using the lib.https://pastebin.com/p8TWvL1K
The text was updated successfully, but these errors were encountered: